[PATCH] D59919: [Attributor] Deduce "returned" argument attribute

2019-06-09 Thread Nick Lewycky via Phabricator via cfe-commits
nicholas added a comment. > CHANGED: build-libcalls NumNoUnwind > 4526 -> 3382 ( -25.276%) Why did the number of nounwinds drop? Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:115 +template +static void

[PATCH] D48100: Append new attributes to the end of an AttributeList.

2018-06-12 Thread Nick Lewycky via Phabricator via cfe-commits
nicholas added inline comments. Comment at: lib/Sema/SemaOverload.cpp:6194 static SmallVector getOrderedEnableIfAttrs(const FunctionDecl *Function) { SmallVector Result; This function shouldn't be necessary any more. All it's doing now is making an

[PATCH] D40850: suppress undefined-template warnings when the pattern is declared in a system header

2018-01-02 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. Ping! https://reviews.llvm.org/D40850 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40850: suppress undefined-template warnings when the pattern is declared in a system header

2017-12-05 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. The way to fix an undefined-template warning is to add lines to the header file that defines the template pattern. We should suppress the warnings when the template pattern is in a system header because we don't expect users to edit those.

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-05-15 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. Ping! https://reviews.llvm.org/D31839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-05-09 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. Ping! https://reviews.llvm.org/D31839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-30 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky updated this revision to Diff 97253. nlewycky added a comment. Use an RAII object to always evaluate the arguments, except if HandleFunctionCall does it. https://reviews.llvm.org/D31839 Files: lib/AST/ExprConstant.cpp test/Sema/integer-overflow.c Index:

[PATCH] D32675: in expression evaluator, treat non-literal types as discarded value expressions if EvalInfo says to continue evaluating them

2017-04-30 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Make the integer overflow evaluator continue into expressions with non-literal types, notably void. In passing it fixes a crash attempting to codegen: struct A { char x; }; struct B : virtual A {}; A = ((A&)*(B*)0); which we nearly have a test for except

[PATCH] D32412: analyze all kinds of expressions for integer overflow

2017-04-28 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky updated this revision to Diff 97179. nlewycky added a comment. [No changes, just full context this time.] https://reviews.llvm.org/D32412 Files: include/clang/Sema/Sema.h lib/AST/ExprConstant.cpp lib/Sema/SemaChecking.cpp

[PATCH] D32412: analyze all kinds of expressions for integer overflow

2017-04-28 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. > If we're now catching integer overflow in more cases, please add some > relevant testcases. Both more and fewer. More because we no longer have a whitelist of three kinds of expressions that we recurse into. Fewer because we no longer call IgnoreParenCasts() on the

[PATCH] D32412: analyze all kinds of expressions for integer overflow

2017-04-28 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky updated this revision to Diff 97178. nlewycky edited the summary of this revision. nlewycky added a comment. Rebase. Now that ObjCBoxedExpr change is in, we can remove Sema::CheckForIntOverflow entirely. https://reviews.llvm.org/D32412 Files: include/clang/Sema/Sema.h

[PATCH] D32410: change the way the expr evaluator handles objcboxedexpr

2017-04-28 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky updated this revision to Diff 97173. nlewycky added a comment. If the boxing method can't be constexpr then we can never evaluate it for a constant value, which means that we should unconditionally return Error, and use noteFailure to decide whether to visit the subexpr.

[PATCH] D32455: detect integer overflow inside arms of conditional operator with non-constant expression

2017-04-24 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Herald added subscribers: rengolin, aemerson. Descend into both the true and false expressions of a ConditionalOperator when the condition can't be evaluated and we're in an evaluation-mode that says we should continue evaluating.

[PATCH] D32412: analyze all kinds of expressions for integer overflow

2017-04-23 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Remove clang::Sema::CheckForIntOverflow(E) by calling into E->EvaluateForOverflow instead. CheckForIntOverflow implemented a whitelist of top-level expressions to check, currently BinaryOperator and InitListExpr. Two changes are made to avoid regression with the

[PATCH] D32410: change the way objcboxedexpr is handled

2017-04-23 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Make ObjCBoxedExpr less of a special case, teach the expression evaluator to handle it in general, sometimes descending through to its subexpr. Remove the code that called CheckForIntOverflow from outside BuildObjCBoxedExpr, leaving its only caller

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-11 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. In https://reviews.llvm.org/D31839#724551, @ahatanak wrote: > OK, thanks for looking into it. Warnings for ObjCMessageExpr can probably be > implemented in a separate patch. > > It looks like clang still doesn't issue overflow warnings when the called > functions have

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-11 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky added a comment. In https://reviews.llvm.org/D31839#722763, @ahatanak wrote: > Is it possible to fix ObjCMessageExpr too while you are in here? I looked into this, but it turns out to be different enough to belong in a separate patch. An ObjCMessageExpr has void type which means that

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-10 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. When checkingForOverflow(), look through call arguments (and the callee itself if calculated). Make the statement visitor go through ObjCBoxedExpr by default because it has a single subexpr node. Don't do that when looking for a pointer object, stop because the

[PATCH] D29915: emit constant expression for new expression array size if it is one

2017-02-13 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. When the new expr's array size is an ICE, emit it as a constant expression. This bypasses integer sanitization checks which are redundant on the expression since it's been checked by Sema. Fixes a clang codegen assertion on "void test() { new int[0+1]{0}; }"