[PATCH] D12000: Bugfix - Clang handles __builtin_object_size in wrong way

2015-08-12 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a subscriber: cfe-commits. Attached is a fix for https://llvm.org/bugs/show_bug.cgi?id=15212 . Summary: Tighten up some of the results for __builtin_object_size(ptr, type) when given type == 1 or type == 3 + fixed a bug where we

r245323 - Make __builtin_object_size always answer correctly

2015-08-18 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Tue Aug 18 13:18:27 2015 New Revision: 245323 URL: http://llvm.org/viewvc/llvm-project?rev=245323view=rev Log: Make __builtin_object_size always answer correctly __builtin_object_size would return incorrect answers for many uses where type=3. This fixes the inaccuracy by

Re: [PATCH] D12000: Bugfix - Clang handles __builtin_object_size in wrong way

2015-08-18 Thread George Burgess IV via cfe-commits
george.burgess.iv closed this revision. george.burgess.iv added a comment. r245323 http://reviews.llvm.org/D12000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-08-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 a subscriber: cfe-commits. (Hoping the formatting works as one would expect) Motivating examples: Pre-patch: ``` __builtin_object_size((char*)foo, 0) != __builtin_object_size(foo, 0) //

Re: [PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-08-19 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 32662. george.burgess.iv added a comment. Removed advanced debugging tools (iostream) http://reviews.llvm.org/D12169 Files: lib/AST/ExprConstant.cpp test/CXX/expr/expr.const/p2-0x.cpp test/CodeGen/object-size.c Index:

Re: [PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-08-20 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/AST/ExprConstant.cpp:4763 @@ +4762,3 @@ + /// arithmetic. + bool UseStrictCastingRules; + rsmith wrote: This should be handled as an `EvaluationMode`. Works for me. Comment at:

Re: [PATCH] D12000: Bugfix - Clang handles __builtin_object_size in wrong way

2015-08-17 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/AST/ExprConstant.cpp:6221-6223 @@ +6220,5 @@ + // + // extern struct X { char buff[32]; int a, b, c; } *p; + // int a = __builtin_object_size(p-buff + 4, 3); // returns 28 + // int b = __builtin_object_size(p-buff

Re: [PATCH] D12000: Bugfix - Clang handles __builtin_object_size in wrong way

2015-08-17 Thread George Burgess IV via cfe-commits
george.burgess.iv updated the summary for this revision. george.burgess.iv updated this revision to Diff 32333. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. Addressed feedback. http://reviews.llvm.org/D12000 Files: lib/AST/ExprConstant.cpp

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

2015-11-13 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: include/clang/AST/Expr.h:631-634 @@ -630,1 +630,6 @@ + /// tryEvaluateObjectSize - If the current Expr is a pointer, this will try to + /// statically determine how many bytes remain in the object this pointer is + ///

[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

[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=37552#toc Repository: rL LLVM

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=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 issues

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[] =

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

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

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=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

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=37062#toc Repository: rL LLVM

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=rev Log: Fix warning caused by r249995 Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL:

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
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=37138#toc Repository: rL LLVM

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=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

r250090 - [Sema] Make `_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=rev Log: [Sema] Make `_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. For

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 `_with_enable_if_attrs` an error (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13607?vs=37075=37152#toc Repository: rL LLVM

[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++

[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

[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

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

2015-10-09 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 36972. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. Addressed all feedback. Also, updated object-size tests to use CHECK-LABEL instead of CHECK, because yay I’m learning how to do things properly.

Re: [PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-09-04 Thread George Burgess IV via cfe-commits
george.burgess.iv closed this revision. george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. r246877. Thanks for the review! (Also: Forgot to submit comments with the most recent revision, so you're getting them all now. Sorry. :) ) Comment

Re: [PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-09-02 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 33875. george.burgess.iv marked 16 inline comments as done. george.burgess.iv added a comment. Addressed all feedback; backed out support for more questionable features (negative indices, non-object-boundary offsets, etc), added logic to ignore

r246890 - Fix a bug in __builtin_object_size cast removal

2015-09-04 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Fri Sep 4 17:36:18 2015 New Revision: 246890 URL: http://llvm.org/viewvc/llvm-project?rev=246890=rev Log: Fix a bug in __builtin_object_size cast removal Apparently there are many cast kinds that may cause implicit pointer arithmetic to happen. In light of this, the cast

Re: [PATCH] D12169: Relax constexpr rules to improve __builtin_object_size's accuracy

2015-08-25 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 33104. george.burgess.iv added a comment. Talked with Richard, and we both agree that adding 4 EvaluationModes is too much for the use case. So, we decided to add a flag to LValue to denote that the LValueBase is invalid. This allows us to get by

Re: r246877 - Increase accuracy of __builtin_object_size.

2015-09-11 Thread George Burgess IV via cfe-commits
> 1) we lost track of the complete object, and > 2) the designator refers to the final subobject of the currently-known > complete object, and > 3) that subobject is either a flexible array member or an array of bound 0 > or 1. > > Then we'd leave it to IR generation to do the

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

2015-09-11 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: cfe-commits, mzolotukhin. In C, a common idiom is: ``` struct Foo { int a; char cs[1] }; struct Foo *F = (struct Foo *)malloc(sizeof(Foo) + strlen(SomeString)); strcpy(F->cs,

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

2015-09-14 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 34710. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. Addressed all feedback -- added a walk of the Designator as suggested. Regarding `isDesignatorAtObjectEnd`: I'm assuming that the Index returned by

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

2015-09-14 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/AST/ExprConstant.cpp:4457-4460 @@ -4434,1 +4456,6 @@ +// Because we set the Base to be the MemberExpr instead of E->getBase(), the +// Offset should be from the MemberExpr instead of the MemberExpr's base. +

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread George Burgess IV via cfe-commits
george.burgess.iv closed this revision. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. Changed code to address all feedback + committed as r249053. Thanks for the reviews! Comment at: lib/Analysis/CFG.cpp:49 @@ +48,3 @@

r249053 - Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Oct 1 13:47:52 2015 New Revision: 249053 URL: http://llvm.org/viewvc/llvm-project?rev=249053=rev Log: Teach -Wtautological-overlap-compare about enums Prior to this patch, -Wtautological-overlap-compare would only warn us if there was a sketchy logical comparison between

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread George Burgess IV via cfe-commits
> Next time, add Differential Revision: to your commit and Phabricator will close the diff automatically. Ooh, shiny. Thanks for letting me know! > Doubling the expense for assert builds so that we get a slightly better stack trace in the event our assumptions are wrong doesn't seem like a good

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

2015-09-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 subscribers: cfe-commits, rsmith. This was a fun patch :) This patch adds the parameter attribute `pass_object_size` to Clang. The design doc for this attribute is available here:

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

2015-09-24 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Friendly ping :) http://reviews.llvm.org/D12821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r248595 - Make incomplete type errors better with enable_if

2015-09-25 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Fri Sep 25 12:53:16 2015 New Revision: 248595 URL: http://llvm.org/viewvc/llvm-project?rev=248595=rev Log: Make incomplete type errors better with enable_if This patch fixes the order in which we evaluate the different ways that a function call could be disallowed. Now, if you

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-25 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Analysis/CFG.cpp:54 @@ +53,3 @@ +auto *DR = dyn_cast(E->IgnoreParenImpCasts()); +if (DR == nullptr) + return nullptr; aaron.ballman wrote: > Please don't compare a pointer against nullptr with

[PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-24 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rtrieu. george.burgess.iv added a subscriber: cfe-commits. Currently, -Wtautological-overlap-compare only emits warnings if the comparisons are between integer literals and variables. This patch adds support for

[PATCH] D15324: [Sema] Emit warnings when comparing result of a function with `returns_nonnull` to null

2015-12-07 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rtrieu. george.burgess.iv added a subscriber: cfe-commits. Addresses a problem brought up by Xavier here: http://permalink.gmane.org/gmane.comp.compilers.clang.devel/46163 tl;dr: We get a warning on the following code

Re: [PATCH] D15324: [Sema] Emit warnings when comparing result of a function with `returns_nonnull` to null

2015-12-08 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Sema/SemaChecking.cpp:7674 @@ +7673,3 @@ +: diag::warn_cast_nonnull_to_bool; +Diag(E->getExprLoc(), DiagID) << int(IsParam) << S.str() + << E->getSourceRange() << Range << IsEqual;

Re: [PATCH] D15324: [Sema] Emit warnings when comparing result of a function with `returns_nonnull` to null

2015-12-08 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 42204. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. - Addressed all feedback - Refactored a loop to make its intent more clear http://reviews.llvm.org/D15324 Files:

r254554 - Add the `pass_object_size` attribute to clang.

2015-12-02 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Dec 2 15:58:08 2015 New Revision: 254554 URL: http://llvm.org/viewvc/llvm-project?rev=254554=rev Log: Add the `pass_object_size` attribute to clang. `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring

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

2015-12-02 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL254554: Add the `pass_object_size` attribute to clang. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D13263?vs=41651=41675#toc Repository: rL LLVM

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

2015-12-02 Thread George Burgess IV via cfe-commits
george.burgess.iv marked 2 inline comments as done. Comment at: lib/AST/ExprConstant.cpp:6507-6509 @@ -6506,5 +6544,1 @@ -// handle all cases where the expression has side-effects. -// Likewise, if Type is 3, we must handle this because CodeGen cannot give a -//

Re: [PATCH] D14938: Fix implicit conversion from _Nullable to _Nonnull warnings in C++

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

r255058 - [Sema] Add warning when comparing nonnull and null

2015-12-08 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Tue Dec 8 16:02:00 2015 New Revision: 255058 URL: http://llvm.org/viewvc/llvm-project?rev=255058=rev Log: [Sema] Add warning when comparing nonnull and null Currently, we emit warnings in some cases where nonnull function parameters are compared against null. This patch

Re: [PATCH] D15324: [Sema] Emit warnings when comparing result of a function with `returns_nonnull` to null

2015-12-08 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL255058: [Sema] Add warning when comparing nonnull and null (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D15324?vs=42204=42221#toc Repository: rL LLVM

Re: [PATCH] D12352: Clang part -- Changing @llvm.objectsize(i8*, i1) to @llvm.objectsize(i8*, i8)

2015-12-04 Thread George Burgess IV via cfe-commits
george.burgess.iv abandoned this revision. george.burgess.iv added a comment. Patch is no longer necessary -- clang can handle `objectsize` well enough on its own. http://reviews.llvm.org/D12352 ___ cfe-commits mailing list

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

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

r254632 - Add tests for pass_object_size.

2015-12-03 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Dec 3 13:19:09 2015 New Revision: 254632 URL: http://llvm.org/viewvc/llvm-project?rev=254632=rev Log: Add tests for pass_object_size. These additions were meant to go in as a part of r254554; while it's certainly nice to have new functionality, it's nicer if we have tests

r254650 - Fix pass_object_size test on Windows.

2015-12-03 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Dec 3 15:15:22 2015 New Revision: 254650 URL: http://llvm.org/viewvc/llvm-project?rev=254650=rev Log: Fix pass_object_size test on Windows. The tests were failing because the types of some member functions, when printed, unexpectedly had "__attribute__((thiscall))" at the

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

2015-12-09 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. Also, due to allowing the evaluation of const expressions as constexpr expressions, this patch needs http://reviews.llvm.org/D14877 to go in so we don't break tests. :) http://reviews.llvm.org/D14274 ___

r255288 - [Sema] Replace pointer-to-map with a map. NFC.

2015-12-10 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Dec 10 13:25:21 2015 New Revision: 255288 URL: http://llvm.org/viewvc/llvm-project?rev=255288=rev Log: [Sema] Replace pointer-to-map with a map. NFC. Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp URL:

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

2015-12-16 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: ``` void foo(int i) __attribute__((enable_if(i < 0, ""))); void foo(double d); auto fooToCall = foo; ``` ...We currently can't determine the type of

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-12-13 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 42683. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. > Changes to ExprConstant and CGExprConstant appear to be pure cleanups; please > check those in as a separate change r255314, thanks. > When this is

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-12-13 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Sema/SemaExpr.cpp:5576 @@ +5575,3 @@ +return ExprError(); + return ImpCastExprToType(CastExprRes.get(), DestElemTy, CK); +} rsmith wrote: > Looking at `ScalarExprEmitter::VisitCastExpr`, it seems like

[PATCH] D15621: [Bugfix] Disallow declarations of named types in parameter lists of overloadable functions in C

2015-12-17 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a subscriber: cfe-commits. This keeps the ICE in https://llvm.org/bugs/show_bug.cgi?id=25836 from happening. Long story short, the following C code will make clang overflow its stack: ``` int Foo(struct A*)

r255314 - Clean ExprConstant/CGExprConstant up a bit. NFC.

2015-12-10 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Thu Dec 10 18:23:35 2015 New Revision: 255314 URL: http://llvm.org/viewvc/llvm-project?rev=255314=rev Log: Clean ExprConstant/CGExprConstant up a bit. NFC. Modified: cfe/trunk/lib/AST/ExprConstant.cpp cfe/trunk/lib/CodeGen/CGExprConstant.cpp Modified:

Re: [PATCH] D14938: Fix implicit conversion from _Nullable to _Nonnull warnings in C++

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

Re: [PATCH] D14938: Fix implicit conversion from _Nullable to _Nonnull warnings in C++

2015-12-14 Thread George Burgess IV via cfe-commits
ts, below. All done. Thanks for the review! :) On Mon, Dec 14, 2015 at 1:20 PM, Justin Bogner <m...@justinbogner.com> wrote: > George Burgess IV via cfe-commits <cfe-commits@lists.llvm.org> writes: > > george.burgess.iv created this revision. > > george.burg

Re: [PATCH] D14938: Fix implicit conversion from _Nullable to _Nonnull warnings in C++

2015-12-14 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL26: [Sema] Make nullness warnings appear in C++. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D14938?vs=40987=42770#toc Repository: rL LLVM

r255556 - [Sema] Make nullness warnings appear in C++.

2015-12-14 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Mon Dec 14 16:00:49 2015 New Revision: 26 URL: http://llvm.org/viewvc/llvm-project?rev=26=rev Log: [Sema] Make nullness warnings appear in C++. Given the following code: int *_Nullable ptr; int *_Nonnull nn = ptr; ...In C, clang will warn you about `nn =

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-12-13 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 42686. george.burgess.iv added a comment. TIL you can use OpenCL vectors in C++ files. Fixed a bug related to not knowing this + added tests for the constexpr cases. Also, is there a better way to do the `bool` -> `APFloat` conversion in

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

2015-12-11 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 42547. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. - Fixed wording in AttrDocs - Realized I forgot to press 'submit' on comment responses after the last update. Will correct this in ~5 seconds :)

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

2015-12-11 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: include/clang/Basic/Attr.td:714 @@ +713,3 @@ + let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[Function]>; + let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>];

r257016 - [Sema] Teach overload resolution about unaddressable functions.

2016-01-06 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Wed Jan 6 20:26:57 2016 New Revision: 257016 URL: http://llvm.org/viewvc/llvm-project?rev=257016=rev Log: [Sema] Teach overload resolution about unaddressable functions. Given an expression like `()();`, we perform overload resolution as if we are calling `Foo` directly. This

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2016-01-06 Thread George Burgess IV via cfe-commits
george.burgess.iv added a comment. > Maybe we could remove CK_BooleanToSignedFloating and model that conversion as > a sequence of CK_BooleanToSignedIntegral followed by CK_IntegralToFloating? I > don't imagine it's a common operation, so the simpler AST representation is > probably worth more

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2016-01-06 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 44187. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. Addressed all feedback, and added tests for `bool` -> `[n x i128]` case. http://reviews.llvm.org/D14877 Files: include/clang/AST/ASTContext.h

Re: [PATCH] D15590: [Bugfix] Disqualify unaddressable overload candidates when a function is directly called indirectly.

2016-01-06 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL257016: [Sema] Teach overload resolution about unaddressable functions. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D15590?vs=43900=44184#toc Repository: rL LLVM

Re: [PATCH] D15721: [Sema] Fix ICE on casting a vector of bools to a vector of T

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

Re: [PATCH] D15721: [Sema] Fix ICE on casting a vector of bools to a vector of T

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

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

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

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

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

[PATCH] D15721: [Sema] Fix ICE on casting a vector of bools to a vector of T

2015-12-22 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: Anastasia. george.burgess.iv added a subscriber: cfe-commits. Clang generally treats booleans as 8-bit types, but lowers them to 1-bit types. This means we currently happily accept C++ code like: ``` typedef

[PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-11-20 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. When evaluating constexpr vector splats, we weren't doing appropriate type conversions on the literal we were splatting, causing assertion failures in cases

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-11-22 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 40895. george.burgess.iv added a comment. We now add implicit casts to splatted literals, as Richard suggested, instead of trying to handle this as a special case in `ExprConstant`. http://reviews.llvm.org/D14877 Files:

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2015-11-22 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/CodeGen/CGExprConstant.cpp:1362-1363 @@ -1360,3 +1361,4 @@ +Inits[I] = llvm::ConstantFP::get(VMContext, Elt.getFloat()); else -Inits.push_back(llvm::ConstantFP::get(VMContext, Elt.getFloat())); +

Re: [PATCH] D15721: [Sema] Fix ICE on casting a vector of bools to a vector of T

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

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2016-01-12 Thread George Burgess IV via cfe-commits
george.burgess.iv marked 2 inline comments as done. george.burgess.iv added a comment. Ping :) http://reviews.llvm.org/D14877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-01-12 Thread George Burgess IV via cfe-commits
t I’m not especially familiar with this part of clang. If >> you or someone else who knows more about this area can figure out the best >> way to fix it, I would appreciate it. >> >> —Bob >> >> > On Oct 11, 2015, at 1:13 PM, George Burgess IV via cfe-commits <

Re: [PATCH] D14877: Fix ICE on lowering of constexpr vector splats

2016-01-12 Thread George Burgess IV via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL257559: [Bugfix] Fix ICE on constexpr vector splat. (authored by gbiv). Changed prior to commit: http://reviews.llvm.org/D14877?vs=44187=44701#toc Repository: rL LLVM http://reviews.llvm.org/D14877

r257559 - [Bugfix] Fix ICE on constexpr vector splat.

2016-01-12 Thread George Burgess IV via cfe-commits
Author: gbiv Date: Tue Jan 12 19:52:39 2016 New Revision: 257559 URL: http://llvm.org/viewvc/llvm-project?rev=257559=rev Log: [Bugfix] Fix ICE on constexpr vector splat. In {CG,}ExprConstant.cpp, we weren't treating vector splats properly. This patch makes us treat splats more properly.

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=rev Log: [Sema] Teach CheckPlaceholderExpr about unaddressable functions. Given the following C++: ``` void foo(); void foo() __attribute__((enable_if(false, ""))); bool bar() {

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

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=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=58526#toc Repository: rL LLVM

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=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

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] 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!

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

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,

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=61048#toc Repository: rL LLVM

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=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

  1   2   3   4   >