[PATCH] D13604: Fix to allow C conversions on arguments passed to functions with __attribute__((overloadable)) in C

2015-10-09 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. The following is legal in C, and illegal in C++: ``` void *getPtr(); void foo(char *c); int main() { foo(getPtr()); } ``` Currently, we only allow C++ c

[PATCH] D13607: [Fix] Make it an error to take the address of (most) enable_if functions.

2015-10-09 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. For the following function: ``` int foo(int a) __attribute__((enable_if(a > 0, “”))); ``` The callee should be able to reasonably assume that `foo` will be call

Re: [PATCH] D13604: Fix to allow C conversions on arguments passed to functions with __attribute__((overloadable)) in C

2015-10-11 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL249995: [Sema] Allow C conversions in C overload logic (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13604?vs=36986&id=37062#toc Repository: rL LLVM http://reviews.llvm.org/D

r249995 - [Sema] Allow C conversions in C overload logic

2015-10-11 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Sun Oct 11 15:13:20 2015 New Revision: 249995 URL: http://llvm.org/viewvc/llvm-project?rev=249995&view=rev Log: [Sema] Allow C conversions in C overload logic C allows for some implicit conversions that C++ does not, e.g. void* -> char*. This patch teaches clang that these conv

r249997 - Fix warning caused by r249995

2015-10-11 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Sun Oct 11 15:37:14 2015 New Revision: 249997 URL: http://llvm.org/viewvc/llvm-project?rev=249997&view=rev Log: Fix warning caused by r249995 Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-projec

Re: [PATCH] D13607: [Fix] Make it an error to take the address of (most) enable_if functions.

2015-10-11 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 37075. george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. Addressed all feedback by rolling two of our overloading checks into one. http://reviews.llvm.org/D13607 Files: include/clang/Basic/DiagnosticSemaKinds

Re: [PATCH] D13607: [Fix] Make it an error to take the address of (most) enable_if functions.

2015-10-11 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Sema/SemaInit.cpp:4978-4990 @@ -4977,1 +4977,15 @@ +// As an extension, C can have overloaded functions. We need to add the +// address resolution step. +if (Initializer->getType() == Context.OverloadTy) { +

[PATCH] D13664: [Fix] Don't emit multiple diagnostics for the same error

2015-10-12 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. Given code like the following (stolen from tests): ``` template int f(T1 *, const T2 *); template int f(const T1 *, T2 *); int (*p)(const int *, const int *) =

Re: [PATCH] D13664: [Fix] Don't emit multiple diagnostics for the same error

2015-10-12 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 37137. george.burgess.iv added a comment. Un-nested an if statement. http://reviews.llvm.org/D13664 Files: lib/Sema/SemaOverload.cpp test/SemaCXX/addr-of-overloaded-function.cpp Index: test/SemaCXX/addr-of-overloaded-function.cpp

r250078 - [Sema] Don't emit multiple diags for one error

2015-10-12 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Oct 12 13:40:58 2015 New Revision: 250078 URL: http://llvm.org/viewvc/llvm-project?rev=250078&view=rev Log: [Sema] Don't emit multiple diags for one error Fixed a bug where we'd emit multiple diagnostics if there was a problem taking the address of an overloaded template fu

Re: [PATCH] D13664: [Fix] Don't emit multiple diagnostics for the same error

2015-10-12 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250078: [Sema] Don't emit multiple diags for one error (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13664?vs=37137&id=37138#toc Repository: rL LLVM http://reviews.llvm.org/D

r250090 - [Sema] Make `&function_with_enable_if_attrs` an error

2015-10-12 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Oct 12 14:57:04 2015 New Revision: 250090 URL: http://llvm.org/viewvc/llvm-project?rev=250090&view=rev Log: [Sema] Make `&function_with_enable_if_attrs` an error This fixes a bug where one can take the address of a conditionally enabled function to drop its enable_if guards

Re: [PATCH] D13607: [Fix] Make it an error to take the address of (most) enable_if functions.

2015-10-12 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250090: [Sema] Make `&function_with_enable_if_attrs` an error (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13607?vs=37075&id=37152#toc Repository: rL LLVM http://reviews.llv

[PATCH] D13704: [Fix] Allow implicit conversions of the address of overloadable functions in C + docs update

2015-10-13 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. Two smallish patches in one. Happy to split into two (for review and/or commit) if that's preferred. In C, we allow (as an extension) incompatible pointer conve

[PATCH] D13795: Prefer functions with true enable_if conditions when attempting to resolve the address of an overload

2015-10-15 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. Our overload resolution logic considers some candidate A better than some candidate B if the set of A's enable_if conditions is a strict superset of the set of

Re: [PATCH] D13795: Prefer functions with true enable_if conditions when attempting to resolve the address of an overload

2015-10-15 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250486: [Sema] Fix address-of + enable_if overloading logic (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13795?vs=37545&id=37552#toc Repository: rL LLVM http://reviews.llvm.

r250486 - [Sema] Fix address-of + enable_if overloading logic

2015-10-15 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Oct 15 20:17:38 2015 New Revision: 250486 URL: http://llvm.org/viewvc/llvm-project?rev=250486&view=rev Log: [Sema] Fix address-of + enable_if overloading logic Previously, our logic when taking the address of an overloaded function would not consider enable_if attributes, s

r250488 - Make __builtin_object_size more conservative

2015-10-15 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Oct 15 20:49:01 2015 New Revision: 250488 URL: http://llvm.org/viewvc/llvm-project?rev=250488&view=rev Log: Make __builtin_object_size more conservative r246877 made __builtin_object_size substantially more aggressive with unknown bases if Type=1 or Type=3, which causes iss

Re: [PATCH] D12821: Allow for C's "writing off the end" idiom in __builtin_object_size

2015-10-15 Thread George Burgess IV via cfe-commits
george.burgess.iv closed this revision. george.burgess.iv marked 3 inline comments as done. george.burgess.iv added a comment. r250488. Thanks for the review! http://reviews.llvm.org/D12821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

Re: [PATCH] D13871: Add modernize-use-default check to clang-tidy.

2015-10-19 Thread George Burgess IV via cfe-commits
george.burgess.iv added a subscriber: george.burgess.iv. george.burgess.iv added a comment. This looks like a good check -- thanks for adding it! Just one small nit for you. Comment at: clang-tidy/modernize/UseDefaultCheck.cpp:19 @@ +18,3 @@ + +const char CtorDtor[] = "CtorDtor

Re: [PATCH] D13263: Addition of __attribute__((pass_object_size)) to Clang

2015-10-20 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 37935. george.burgess.iv added a comment. Rebased http://reviews.llvm.org/D13263 Files: include/clang/AST/Expr.h include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds

Re: [PATCH] D13704: [Fix] Allow implicit conversions of the address of overloadable functions in C + docs update

2015-10-20 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 37965. george.burgess.iv added a comment. Rebased http://reviews.llvm.org/D13704 Files: include/clang/Basic/AttrDocs.td lib/Sema/SemaOverload.cpp test/CodeGen/overloadable.c test/Sema/overloadable.c Index: test/Sema/overloadable.c ===

Re: [PATCH] Bug 15109: Implement -Wdouble-promotion for clang

2015-10-28 Thread George Burgess IV via cfe-commits
Thanks for this patch! :) Just a few small nits: - Is there a reason that test/SemaCXX/warn-double-promotion.cpp can't be at test/Sema/warn-double-promotion.c instead? - Can we make the warning message a bit more specific? Maybe something like "implicit conversion increases floating-point precision

r251588 - [Sema] Implement -Wdouble-promotion for clang.

2015-10-28 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Oct 28 19:28:52 2015 New Revision: 251588 URL: http://llvm.org/viewvc/llvm-project?rev=251588&view=rev Log: [Sema] Implement -Wdouble-promotion for clang. GCC has a warning called -Wdouble-promotion, which warns you when an implicit conversion increases the width of a float

Re: [PATCH] Bug 15109: Implement -Wdouble-promotion for clang

2015-10-28 Thread George Burgess IV via cfe-commits
Committed as r251588 -- thanks again! FYI: I'm assuming that you meant to change the test to warn-double-promotion.c instead of leaving it as warn-double-promotion.cpp, so I made that fix for you prior to committing. If this is isn't something you wanted, please let me know. :) 2015-10-28 17:02 G

[PATCH] D14274: Add alloc_size attribute to clang

2015-11-02 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. This is the first in a two patch series aimed at adding the alloc_size attribute to clang. This patch adds the alloc_size attribute, docs, and all of the logic

r276232 - [Sema] Fix PR28623.

2016-07-20 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Jul 20 22:28:13 2016 New Revision: 276232 URL: http://llvm.org/viewvc/llvm-project?rev=276232&view=rev Log: [Sema] Fix PR28623. In atomic builtins, we assumed that the LValue conversion on the first argument would succeed. So, we would crash given code like: ``` void ovl(c

Re: r276232 - [Sema] Fix PR28623.

2016-07-22 Thread George Burgess IV via cfe-commits
Error message says r272936 had the error, so it looks like it would, yeah. :) Would you like me to merge it to the 3.9 branch? On Fri, Jul 22, 2016 at 6:51 AM, Hans Wennborg wrote: > Does this apply to 3.9? > > On Wed, Jul 20, 2016 at 11:28 PM, George Burgess IV via cfe-commits

Re: r276232 - [Sema] Fix PR28623.

2016-07-22 Thread George Burgess IV via cfe-commits
ke me to merge it to the 3.9 branch? > > On Fri, Jul 22, 2016 at 6:51 AM, Hans Wennborg wrote: > >> Does this apply to 3.9? >> >> On Wed, Jul 20, 2016 at 11:28 PM, George Burgess IV via cfe-commits >> wrote: >> > Author: gbiv >> > Date: Wed Jul 20 22:

Re: r276232 - [Sema] Fix PR28623.

2016-07-22 Thread George Burgess IV via cfe-commits
t;> Would you like me to merge it to the 3.9 branch? >>> >>> On Fri, Jul 22, 2016 at 6:51 AM, Hans Wennborg >>> wrote: >>> >>>> Does this apply to 3.9? >>>> >>>> On Wed, Jul 20, 2016 at 11:28 PM, George Burgess IV via cfe

r276577 - [Sema] Replace mem_fn with lambdas. NFC.

2016-07-24 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Sun Jul 24 18:12:40 2016 New Revision: 276577 URL: http://llvm.org/viewvc/llvm-project?rev=276577&view=rev Log: [Sema] Replace mem_fn with lambdas. NFC. I'm told that some optimizers like lambdas a lot more than mem_fn. Given that the readability difference is basically nil, an

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-08-03 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. > I'm wondering what the status of this patch is since someone has asked us to > add support for this attribute in clang. Are you still waiting for review? Waiting for an LGTM from Richard, though this patch currently doesn't pass all tests. One of the change

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-08-03 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: test/CodeGenCXX/alloc-size.cpp:66 @@ +65,3 @@ + // CHECK: ret i32 122 + return __builtin_object_size(my_malloc(), 0) + + __builtin_object_size(my_calloc(5), 0) + ahatanak wrote: > george.burgess.iv wro

r278471 - [Sema] Fix a crash on variadic enable_if functions.

2016-08-11 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Aug 11 23:12:31 2016 New Revision: 278471 URL: http://llvm.org/viewvc/llvm-project?rev=278471&view=rev Log: [Sema] Fix a crash on variadic enable_if functions. Currently, when trying to evaluate an enable_if condition, we try to evaluate all arguments a user passes to a fun

Re: r278471 - [Sema] Fix a crash on variadic enable_if functions.

2016-08-11 Thread George Burgess IV via cfe-commits
Hi Richard, Would you mind if I merged this into the 3.9 branch? :) Thanks, George On Thu, Aug 11, 2016 at 9:12 PM, George Burgess IV via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: gbiv > Date: Thu Aug 11 23:12:31 2016 > New Revision: 278471 > > URL: http:/

r278472 - [Sema] Fix the wording of a comment. NFC.

2016-08-11 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Aug 11 23:19:35 2016 New Revision: 278472 URL: http://llvm.org/viewvc/llvm-project?rev=278472&view=rev Log: [Sema] Fix the wording of a comment. NFC. Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/viewv

Re: r278471 - [Sema] Fix a crash on variadic enable_if functions.

2016-08-11 Thread George Burgess IV via cfe-commits
hanks, > George > > On Thu, Aug 11, 2016 at 9:12 PM, George Burgess IV via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: gbiv >> Date: Thu Aug 11 23:12:31 2016 >> New Revision: 278471 >> >> URL: http://llvm.org/viewvc/llv

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-02-02 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:737 @@ +736,3 @@ +unsigned FuncParamNo, unsigned AttrArgNo) { + assert(Attr.getArg(AttrArgNo).is()); + // FuncParamNo is base-1 aaron.ballman wrote

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-02-02 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 46693. george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. Addressed all feedback. http://reviews.llvm.org/D14274 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/Diagn

Re: [PATCH] D17166: [Sema] More changes to fix Objective-C fallout from r249995.

2016-02-11 Thread George Burgess IV via cfe-commits
george.burgess.iv accepted this revision. george.burgess.iv added a comment. This revision is now accepted and ready to land. Sorry that the change to overload resolution turned out to be problematic. :) One nit, and this LGTM. Comment at: lib/Sema/SemaExpr.cpp:7580 @@ +7579,3

Re: [PATCH] D13704: [Fix] Allow implicit conversions of the address of overloadable functions in C + docs update

2016-02-12 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. FYI: I noticed a few cases this patch misses. Will add them soon. http://reviews.llvm.org/D13704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D13704: [Fix] Allow implicit conversions of the address of overloadable functions in C + docs update

2016-02-16 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 48111. george.burgess.iv added a comment. - Reworded docs update - Added support for `reinterpret_cast`s of overloaded functions in both C and C++ - Added general facility in `Sema` to query if an overloaded expression can resolve to being not-over

[PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-02-19 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added subscribers: srhines, cfe-commits. Currently, we get assertion failures/segfaults for variadic functions with `pass_object_size` params, e.g.: ``` void foo(void *const __attribute__((pass

r261798 - Minor cleanup of Sema::CheckEnableIf. NFC.

2016-02-24 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Feb 24 16:31:14 2016 New Revision: 261798 URL: http://llvm.org/viewvc/llvm-project?rev=261798&view=rev Log: Minor cleanup of Sema::CheckEnableIf. NFC. Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/view

Re: [PATCH] D16298: Improve test coverage of -Wdouble-promotion

2016-04-28 Thread George Burgess IV via cfe-commits
george.burgess.iv added a subscriber: george.burgess.iv. george.burgess.iv accepted this revision. george.burgess.iv added a reviewer: george.burgess.iv. george.burgess.iv added a comment. This revision is now accepted and ready to land. Hey -- I'm really sorry about the latency on this; I recentl

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-04-28 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 55478. george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. Addressed all feedback http://reviews.llvm.org/D14274 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/Diagno

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-04-28 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: include/clang/Basic/Attr.td:753 @@ +752,3 @@ + let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>]; + let TemplateDependent = 1; + let Documentation = [AllocSizeDocs]; aaron.ballman wro

r268113 - [Sema] Specify the underlying type for an enum. NFC.

2016-04-29 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Fri Apr 29 16:32:53 2016 New Revision: 268113 URL: http://llvm.org/viewvc/llvm-project?rev=268113&view=rev Log: [Sema] Specify the underlying type for an enum. NFC. Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llv

Re: r268113 - [Sema] Specify the underlying type for an enum. NFC.

2016-04-29 Thread George Burgess IV via cfe-commits
Right under the enum is an 11x11 static array of PromotedType. This change makes that array size go from 484 bytes to 121. On Fri, Apr 29, 2016 at 2:43 PM, Aaron Ballman wrote: > On Fri, Apr 29, 2016 at 5:32 PM, George Burgess IV via cfe-commits > wrote: > > Author: gbiv > >

Re: r268113 - [Sema] Specify the underlying type for an enum. NFC.

2016-04-29 Thread George Burgess IV via cfe-commits
the > commit message (in case we ever do code archaeology for some reason). > Thank you for the explanation! > > ~Aaron > > > > > On Fri, Apr 29, 2016 at 2:43 PM, Aaron Ballman > > wrote: > >> > >> On Fri, Apr 29, 2016 at 5:32 PM, George Burgess I

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-05-04 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D17462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r269005 - [Sema] Fix an overload resolution bug with enable_if.

2016-05-09 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon May 9 20:59:34 2016 New Revision: 269005 URL: http://llvm.org/viewvc/llvm-project?rev=269005&view=rev Log: [Sema] Fix an overload resolution bug with enable_if. Currently, if clang::isBetterOverloadCandidate encounters an enable_if attribute on either candidate that it's i

[PATCH] D20130: Fix enable_if evaluation in value-dependent contexts.

2016-05-10 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. This patch is meant to be applied instead of D18425, but is a new review because we're taking an entirely different approach. This patch makes us fail `enable_i

Re: [PATCH] D18425: [Sema] Make enable_if act correctly with value dependent conditions/arguments

2016-05-10 Thread George Burgess IV via cfe-commits
george.burgess.iv abandoned this revision. george.burgess.iv added a comment. Abandoning this; http://reviews.llvm.org/D20130 is our new approach. http://reviews.llvm.org/D18425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

r269154 - [Sema] Fix value-dependent enable_if bug.

2016-05-10 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Tue May 10 20:38:27 2016 New Revision: 269154 URL: http://llvm.org/viewvc/llvm-project?rev=269154&view=rev Log: [Sema] Fix value-dependent enable_if bug. This patch fixes a bug where we would assume all value-dependent enable_if conditions give successful results. Instead, we

Re: [PATCH] D20130: Fix enable_if evaluation in value-dependent contexts.

2016-05-10 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269154: [Sema] Fix value-dependent enable_if bug. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D20130?vs=56786&id=56849#toc Repository: rL LLVM http://reviews.llvm.org/D20130

r264975 - [Sema] Fix PR27122: ICE with enable_if+ill-formed call.

2016-03-30 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Mar 30 19:16:25 2016 New Revision: 264975 URL: http://llvm.org/viewvc/llvm-project?rev=264975&view=rev Log: [Sema] Fix PR27122: ICE with enable_if+ill-formed call. In some cases, when we encounter a direct function call with an incorrect number of arguments, we'll emit a di

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-03-30 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 52167. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. Addressed all feedback. http://reviews.llvm.org/D18540 Files: lib/AST/ExprConstant.cpp test/SemaCXX/builtin-object-size-cxx14.cpp test/SemaCXX/cons

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-03-30 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: include/clang/AST/Expr.h:541-546 @@ -540,1 +540,8 @@ +/// \brief Whether the evaluation was unable to reduce a construct to a +/// value. +/// +/// For example, in foo(bar, baz, qux), if evaluating bar fails, w

Re: [PATCH] D18425: [Sema] Make enable_if act correctly with value dependent conditions/arguments

2016-04-04 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping ;) http://reviews.llvm.org/D18425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-04-04 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D18540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D18765: [clang-tidy] Don't complain about const pass_object_size params in declarations

2016-04-04 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: alexfh. george.burgess.iv added a subscriber: cfe-commits. This patch seems trivial, but I've never touched clang-tidy before, so I'm just making sure I didn't miss something obvious. :) -- Clang has a parameter attrib

r265341 - [Sema] Delete FIXME that has been fixed. NFC.

2016-04-04 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Apr 4 14:44:16 2016 New Revision: 265341 URL: http://llvm.org/viewvc/llvm-project?rev=265341&view=rev Log: [Sema] Delete FIXME that has been fixed. NFC. Modified: cfe/trunk/lib/Sema/SemaExpr.cpp Modified: cfe/trunk/lib/Sema/SemaExpr.cpp URL: http://llvm.org/viewvc/ll

Re: [PATCH] D18425: [Sema] Make enable_if act correctly with value dependent conditions/arguments

2016-04-04 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 52619. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. Addressed most feedback; see comments. :) http://reviews.llvm.org/D18425 Files: include/clang/Sema/Sema.h lib/Sema/SemaExpr.cpp lib/Sema/SemaOverlo

Re: [PATCH] D18425: [Sema] Make enable_if act correctly with value dependent conditions/arguments

2016-04-04 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Sema/SemaExpr.cpp:5047-5098 @@ -5046,57 +5046,54 @@ +CallExpr *Sema::buildDependentCallExpr(Expr *ExecConfig, Expr *Fn, + MultiExprArg ArgExprs, +

Re: [PATCH] D18765: [clang-tidy] Don't complain about const pass_object_size params in declarations

2016-04-05 Thread George Burgess IV via cfe-commits
george.burgess.iv abandoned this revision. george.burgess.iv added a comment. > There's a principal difference between top-level const on parameters in > definitions and in declarations: in definitions const has an effect, as it > makes the variable constant, but in declarations it has absolutel

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-04-06 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 52834. george.burgess.iv marked 7 inline comments as done. george.burgess.iv added a comment. Addressed feedback http://reviews.llvm.org/D18540 Files: lib/AST/ExprConstant.cpp test/SemaCXX/builtin-object-size-cxx14.cpp test/SemaCXX/constant-

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-04-06 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/AST/ExprConstant.cpp:853-854 @@ -825,5 +852,4 @@ Info.EvalStatus.Diag = NewDiag; // If we're speculatively evaluating, we may have skipped over some // evaluations and missed out a side effect. } --

Re: [PATCH] D14274: Add alloc_size attribute to clang

2016-04-13 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 53611. george.burgess.iv added a comment. Now that `allocsize` is in LLVM (r266032), this isn't blocked. Yay! Rebased, added a few tests, did a few tiny refactors, and fixed an overflow bug when the user tried to allocate `2**63 < N < 2**64` bytes

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-04-22 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D18540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r267447 - [Docs] Clarify what the object-size sanitizer does.

2016-04-25 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Apr 25 14:21:45 2016 New Revision: 267447 URL: http://llvm.org/viewvc/llvm-project?rev=267447&view=rev Log: [Docs] Clarify what the object-size sanitizer does. Currently, the UBSan docs make it sound like the object-size sanitizer will only detect out-of-bounds reads/writes

r267501 - [Docs] Fix indentation error introduced by r267447.

2016-04-25 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Apr 25 19:31:29 2016 New Revision: 267501 URL: http://llvm.org/viewvc/llvm-project?rev=267501&view=rev Log: [Docs] Fix indentation error introduced by r267447. Modified: cfe/trunk/docs/UndefinedBehaviorSanitizer.rst Modified: cfe/trunk/docs/UndefinedBehaviorSanitizer.r

Re: r267447 - [Docs] Clarify what the object-size sanitizer does.

2016-04-25 Thread George Burgess IV via cfe-commits
src/tools/clang/docs/UndefinedBehaviorSanitizer.rst:96: > WARNING: Bullet list ends without a blank line; unexpected unindent. > > > On Mon, Apr 25, 2016 at 3:21 PM, George Burgess IV via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: gbiv >> Dat

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-05-24 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D18540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-05-24 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D17462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r270781 - [Sema] Note when we encounter a problem in ExprConstant.

2016-05-25 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed May 25 17:31:54 2016 New Revision: 270781 URL: http://llvm.org/viewvc/llvm-project?rev=270781&view=rev Log: [Sema] Note when we encounter a problem in ExprConstant. Currently, the constexpr evaluator is very conservative about unmodeled side-effects when we're evaluating an

Re: [PATCH] D18540: [Sema] Note when we've actually encountered a failure in ExprConstant, and take that into account when looking up objects.

2016-05-25 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL270781: [Sema] Note when we encounter a problem in ExprConstant. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D18540?vs=52834&id=58526#toc Repository: rL LLVM http://reviews.

r270784 - [Sema] Use the failure bits introduced by r270781.

2016-05-25 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed May 25 17:38:36 2016 New Revision: 270784 URL: http://llvm.org/viewvc/llvm-project?rev=270784&view=rev Log: [Sema] Use the failure bits introduced by r270781. r270781 introduced the ability to track whether or not we might have had unmodeled side-effects during constant exp

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-01 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D17462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-06 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D17462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r272080 - [Sema] Teach CheckPlaceholderExpr about unaddressable functions.

2016-06-07 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Tue Jun 7 19:34:22 2016 New Revision: 272080 URL: http://llvm.org/viewvc/llvm-project?rev=272080&view=rev Log: [Sema] Teach CheckPlaceholderExpr about unaddressable functions. Given the following C++: ``` void foo(); void foo() __attribute__((enable_if(false, ""))); bool bar

Re: [PATCH] D21352: Add a "declared 'nonnull' here" note to warnings where an expression is checked against null.

2016-06-14 Thread George Burgess IV via cfe-commits
george.burgess.iv added a subscriber: george.burgess.iv. george.burgess.iv accepted this revision. george.burgess.iv added a reviewer: george.burgess.iv. george.burgess.iv added a comment. This revision is now accepted and ready to land. LGTM, thanks for the patch! http://reviews.llvm.org/D21352

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-15 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. (: ƃuıd http://reviews.llvm.org/D17462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-15 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Jun 15 21:30:33 2016 New Revision: 272867 URL: http://llvm.org/viewvc/llvm-project?rev=272867&view=rev Log: [Lex] Try to fix a 'comparison is always false' warning. NFC. Modified: cfe/trunk/lib/Lex/PPDirectives.cpp Modified: cfe/trunk/lib/Lex/PPDirectives.cpp URL: htt

Re: r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-16 Thread George Burgess IV via cfe-commits
ldn't this produce UB on a signed char > platform in the case where Ch is negative? (or is that just unspecified? > implementation defined?) > > On Wed, Jun 15, 2016 at 7:30 PM, George Burgess IV via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: g

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-16 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 61041. george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. Addressed all feedback. http://reviews.llvm.org/D17462 Files: include/clang/CodeGen/CGFunctionInfo.h lib/CodeGen/CGCall.cpp lib/CodeGen/CGExprCXX.c

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-16 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/CodeGen/CGExprCXX.cpp:331 @@ -329,3 +330,3 @@ // And the rest of the call args EmitCallArgs(Args, FPT, E->arguments(), E->getDirectCallee()); return EmitCall(CGM.getTypes().arrangeCXXMethodCall(Args, FPT, required),

r272971 - [CodeGen] Fix a segfault caused by pass_object_size.

2016-06-16 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Jun 16 18:06:04 2016 New Revision: 272971 URL: http://llvm.org/viewvc/llvm-project?rev=272971&view=rev Log: [CodeGen] Fix a segfault caused by pass_object_size. This patch fixes a bug where we'd segfault (in some cases) if we saw a variadic function with one or more pass_ob

Re: [PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

2016-06-16 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL272971: [CodeGen] Fix a segfault caused by pass_object_size. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D17462?vs=61041&id=61048#toc Repository: rL LLVM http://reviews.llvm

Re: [PATCH] D21453: Add support for attribute "overallocated"

2016-06-20 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Thanks for the patch! Comment at: lib/AST/ExprConstant.cpp:1055 @@ +1054,3 @@ +// computation of __builtin_object_size. +bool OverAllocated = 1; + Did you mean `: 1` here? http://reviews.llvm.org/D21453 ___

r273227 - [Docs] Try to fix the docs buildbot.

2016-06-20 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Jun 20 19:16:23 2016 New Revision: 273227 URL: http://llvm.org/viewvc/llvm-project?rev=273227&view=rev Log: [Docs] Try to fix the docs buildbot. It's complaining that it couldn't lex a compiler warning as C++. I don't blame it. Modified: cfe/trunk/docs/LanguageExtensio

r273232 - [Docs] More warning fixes to unbreak the docs buildbot.

2016-06-20 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Jun 20 21:19:43 2016 New Revision: 273232 URL: http://llvm.org/viewvc/llvm-project?rev=273232&view=rev Log: [Docs] More warning fixes to unbreak the docs buildbot. A number of warnings still remain, but these were the last of the "unlexable code"-related ones (AFAICT). I c

r273911 - [ExprConstant] Fix PR28314 - crash while evluating objectsize.

2016-06-27 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Jun 27 14:40:41 2016 New Revision: 273911 URL: http://llvm.org/viewvc/llvm-project?rev=273911&view=rev Log: [ExprConstant] Fix PR28314 - crash while evluating objectsize. This fixes a crash in code like: ``` struct A { struct B b; char c[1]; } int foo(struct A* a) { re

Re: r273911 - [ExprConstant] Fix PR28314 - crash while evluating objectsize.

2016-06-27 Thread George Burgess IV via cfe-commits
+Richard, Hans This patch fixes a crash that's also present in Clang 3.8. So, I think it should find its way into 3.8.2, if possible. Thank you! :) -- Forwarded message -- From: George Burgess IV via cfe-commits Date: Mon, Jun 27, 2016 at 12:40 PM Subject: r2

Re: [PATCH] D22334: Fix for Bug 28172 : clang crashes on invalid code (with too few arguments to __builtin_signbit) without any proper diagnostics.

2016-07-15 Thread George Burgess IV via cfe-commits
george.burgess.iv accepted this revision. george.burgess.iv added a comment. This revision is now accepted and ready to land. LGTM; thanks for the patch! https://reviews.llvm.org/D22334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

Re: [PATCH] D13704: [Fix] Allow implicit conversions of the address of overloadable functions in C + docs update

2016-02-28 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 49333. george.burgess.iv added a comment. Rebased, and narrowed the scope of the patch a bit. http://reviews.llvm.org/D13704 Files: include/clang/Basic/AttrDocs.td lib/Sema/SemaOverload.cpp test/CodeGen/overloadable.c test/Sema/overloadabl

[PATCH] D17701: [Sema] Teach SemaCast to allow reinterpret_casts of overloaded functions with only one addressable candidate

2016-02-28 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. Given the following declarations for `foo`: ``` void foo(int a); void foo(int a) __attribute__((enable_if(a, ""))); ``` ...The only way to `reinterpret_cast` `

Re: [PATCH] D15591: [Bugfix] Make type deduction work more nicely with unaddressable functions

2016-02-28 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 49337. george.burgess.iv added a comment. - Rebased - Added tests for template type inference - Updated to use machinery introduced by http://reviews.llvm.org/D17701 http://reviews.llvm.org/D15591 Files: lib/Sema/SemaTemplateDeduction.cpp test

[PATCH] D17746: Fix PR26741 -- __builtin_object_size is not consistently conservative with C++ inheritance

2016-02-29 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rsmith. george.burgess.iv added a subscriber: cfe-commits. This patch fixes PR26741, and makes us handle inheritance more sanely. Broken code: ``` struct Foo { char a[1]; }; struct Bar : Foo {}; int break() { Bar *b;

Re: [PATCH] D17746: Fix PR26741 -- __builtin_object_size is not consistently conservative with C++ inheritance

2016-03-19 Thread George Burgess IV via cfe-commits
george.burgess.iv abandoned this revision. george.burgess.iv added a comment. I don't feel strongly about how we should handle this, to be honest. Feeding your example into GCC 4.8 like so: #include struct Foo { char k[1]; }; struct Bar : Foo {}; int __attribute__((noinline)) b

<    1   2   3   4   >