[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-26 Thread Devin Coughlin via cfe-commits
@@ -7730,6 +7730,14 @@ def source_date_epoch : Separate<["-"], "source-date-epoch">, } // let Visibility = [CC1Option] +def stdlib_hardening_EQ : Joined<["-"], "fstdlib-hardening=">, devincoughlin wrote: With the name `stdlib_hardening`, are we worried

[clang] abc04ff - [analyzer] Require darwin for scan-build tests

2019-11-04 Thread Devin Coughlin via cfe-commits
Author: Devin Coughlin Date: 2019-11-04T21:17:55-08:00 New Revision: abc04ff4012c62c98aa9f0d840114b2f56855dc8 URL: https://github.com/llvm/llvm-project/commit/abc04ff4012c62c98aa9f0d840114b2f56855dc8 DIFF:

[clang] 48223d9 - [analyzer] Fixup scan-build tests for non-Darwin platforms.

2019-11-04 Thread Devin Coughlin via cfe-commits
Author: Devin Coughlin Date: 2019-11-04T21:12:11-08:00 New Revision: 48223d92a98e2eb7da6844d56471953f83da191e URL: https://github.com/llvm/llvm-project/commit/48223d92a98e2eb7da6844d56471953f83da191e DIFF:

[clang] 0aba69e - [analyzer] Add test directory for scan-build.

2019-11-04 Thread Devin Coughlin via cfe-commits
Author: Devin Coughlin Date: 2019-11-04T20:26:35-08:00 New Revision: 0aba69eb1a01c44185009f50cc633e3c648e9950 URL: https://github.com/llvm/llvm-project/commit/0aba69eb1a01c44185009f50cc633e3c648e9950 DIFF:

r356308 - [analyzer] Teach scan-build to find clang when installed in /usr/local/bin/

2019-03-15 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Mar 15 18:01:29 2019 New Revision: 356308 URL: http://llvm.org/viewvc/llvm-project?rev=356308=rev Log: [analyzer] Teach scan-build to find clang when installed in /usr/local/bin/ Change scan-build to support the scenario where scan-build is installed in

r326062 - [www] Update link to analyzer's "Building a Checker in 24 hours" video

2018-02-25 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Feb 25 16:39:25 2018 New Revision: 326062 URL: http://llvm.org/viewvc/llvm-project?rev=326062=rev Log: [www] Update link to analyzer's "Building a Checker in 24 hours" video The video is now uploaded to YouTube. Modified: cfe/trunk/www/analyzer/alpha_checks.html

r323052 - [analyzer] Provide a check name when MallocChecker enables CStringChecker

2018-01-20 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sat Jan 20 15:11:17 2018 New Revision: 323052 URL: http://llvm.org/viewvc/llvm-project?rev=323052=rev Log: [analyzer] Provide a check name when MallocChecker enables CStringChecker Fix an assertion failure caused by a missing CheckName. The malloc checker enables "basic"

r319638 - [analyzer] Don't treat lambda-captures float constexprs as undefined

2017-12-03 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Dec 3 20:46:47 2017 New Revision: 319638 URL: http://llvm.org/viewvc/llvm-project?rev=319638=rev Log: [analyzer] Don't treat lambda-captures float constexprs as undefined RegionStore has special logic to evaluate captured constexpr variables. However, if the

r319333 - [analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true

2017-11-29 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Nov 29 10:25:37 2017 New Revision: 319333 URL: http://llvm.org/viewvc/llvm-project?rev=319333=rev Log: [analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true In the original design of the analyzer, it was assumed that a BlockEntrance doesn't

r318979 - [analyzer] Teach RetainCountChecker about CoreMedia APIs

2017-11-25 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sat Nov 25 06:57:42 2017 New Revision: 318979 URL: http://llvm.org/viewvc/llvm-project?rev=318979=rev Log: [analyzer] Teach RetainCountChecker about CoreMedia APIs Teach the retain-count checker that CoreMedia reference types use CoreFoundation-style reference counting.

r311063 - [analyzer] Add support for reference counting of parameters on the callee side

2017-08-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Aug 16 21:19:07 2017 New Revision: 311063 URL: http://llvm.org/viewvc/llvm-project?rev=311063=rev Log: [analyzer] Add support for reference counting of parameters on the callee side This commit adds the functionality of performing reference counting on the callee side

r309968 - [Analyzer] Add support for displaying cross-file diagnostic paths in HTML output

2017-08-03 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Thu Aug 3 11:12:22 2017 New Revision: 309968 URL: http://llvm.org/viewvc/llvm-project?rev=309968=rev Log: [Analyzer] Add support for displaying cross-file diagnostic paths in HTML output This change adds support for cross-file diagnostic paths in html output. If the

r308990 - [analyzer] Add diagnostic text for generalized refcount annotations.

2017-07-25 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Jul 25 10:17:09 2017 New Revision: 308990 URL: http://llvm.org/viewvc/llvm-project?rev=308990=rev Log: [analyzer] Add diagnostic text for generalized refcount annotations. Add a 'Generalized' object kind to the retain-count checker and suitable generic diagnostic text

r308416 - [analyzer] Add annotation attribute to trust retain count implementation

2017-07-18 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Jul 18 21:10:44 2017 New Revision: 308416 URL: http://llvm.org/viewvc/llvm-project?rev=308416=rev Log: [analyzer] Add annotation attribute to trust retain count implementation Add support to the retain-count checker for an annotation indicating that a function's

r308242 - [analyzer] Add missing documentation for static analyzer checkers

2017-07-17 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Mon Jul 17 17:34:57 2017 New Revision: 308242 URL: http://llvm.org/viewvc/llvm-project?rev=308242=rev Log: [analyzer] Add missing documentation for static analyzer checkers Some checks did not have documentation in the www/analyzer/ folder and also some alpha checks

r296646 - [analyzer] pr32088: Don't destroy the temporary if its initializer causes return.

2017-03-01 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Mar 1 11:48:39 2017 New Revision: 296646 URL: http://llvm.org/viewvc/llvm-project?rev=296646=rev Log: [analyzer] pr32088: Don't destroy the temporary if its initializer causes return. In the following code involving GNU statement-expression extension: struct S {

r296562 - [Analyzer] Fix crash in ObjCPropertyChecker on protocol property

2017-02-28 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Feb 28 19:47:37 2017 New Revision: 296562 URL: http://llvm.org/viewvc/llvm-project?rev=296562=rev Log: [Analyzer] Fix crash in ObjCPropertyChecker on protocol property Fix a crash in the ObjCPropertyChecker when analyzing a 'copy' property of an NSMutable* type in a

Re: r292800 - [analyzer] Fix memory space of static locals seen from nested blocks.

2017-01-23 Thread Devin Coughlin via cfe-commits
FYI, I reverted r292800 from trunk in r292874. It was causing our internal validation bots to have false positives whenever a static local was dereferenced/passed to a nonnull function in a block evaluated at the top level. Devin > On Jan 23, 2017, at 4:19 PM, Hans Wennborg

r292874 - Revert "[analyzer] Fix memory space of static locals seen from nested blocks."

2017-01-23 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Mon Jan 23 20:10:59 2017 New Revision: 292874 URL: http://llvm.org/viewvc/llvm-project?rev=292874=rev Log: Revert "[analyzer] Fix memory space of static locals seen from nested blocks." This reverts commit r292800. It is causing null pointer dereference false positives

r291635 - [analyzer] Fix crash in body farm for getter without implicit self.

2017-01-10 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Jan 10 19:02:34 2017 New Revision: 291635 URL: http://llvm.org/viewvc/llvm-project?rev=291635=rev Log: [analyzer] Fix crash in body farm for getter without implicit self. Fix a crash in body farm when synthesizing a getter for a property synthesized for a property

r291581 - [analyzer] Treat pointers to static member functions as function pointers

2017-01-10 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Jan 10 12:49:27 2017 New Revision: 291581 URL: http://llvm.org/viewvc/llvm-project?rev=291581=rev Log: [analyzer] Treat pointers to static member functions as function pointers Sema treats pointers to static member functions as having function pointer type, so treat

r290352 - [analyzer] Update GTestChecker to tighten API detection

2016-12-22 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Thu Dec 22 11:52:57 2016 New Revision: 290352 URL: http://llvm.org/viewvc/llvm-project?rev=290352=rev Log: [analyzer] Update GTestChecker to tighten API detection Update the GTestChecker to tighten up the API detection and make it cleaner in response to post-commit

r290143 - [analyzer] Add checker modeling gtest APIs.

2016-12-19 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Mon Dec 19 16:50:31 2016 New Revision: 290143 URL: http://llvm.org/viewvc/llvm-project?rev=290143=rev Log: [analyzer] Add checker modeling gtest APIs. gtest is a widely-used unit-testing API. It provides macros for unit test assertions: ASSERT_TRUE(p != nullptr); that

r290140 - [analyzer] Add sink after construction of temporary with no-return destructor.

2016-12-19 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Mon Dec 19 16:23:22 2016 New Revision: 290140 URL: http://llvm.org/viewvc/llvm-project?rev=290140=rev Log: [analyzer] Add sink after construction of temporary with no-return destructor. The analyzer's CFG currently doesn't have nodes for calls to temporary destructors.

r290023 - [analyzer] UnixAPIChecker: Don't diagnose for functions in C++ namespaces

2016-12-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Dec 16 19:08:17 2016 New Revision: 290023 URL: http://llvm.org/viewvc/llvm-project?rev=290023=rev Log: [analyzer] UnixAPIChecker: Don't diagnose for functions in C++ namespaces Update the UnixAPIChecker to not diagnose for calls to functions that are declared in C++

r289970 - [analyzer] Fix crash in MallocChecker.

2016-12-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Dec 16 12:41:40 2016 New Revision: 289970 URL: http://llvm.org/viewvc/llvm-project?rev=289970=rev Log: [analyzer] Fix crash in MallocChecker. Fix a crash in the MallocChecker when the extent size for the argument to new[] is not known. A patch by Abramo Bagnara and

r289873 - [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-15 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Thu Dec 15 15:27:06 2016 New Revision: 289873 URL: http://llvm.org/viewvc/llvm-project?rev=289873=rev Log: [analyzer] Add a new SVal to support pointer-to-member operations. Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal supports both

r289685 - [Driver] Add tests for enabled static analyzer checkers.

2016-12-14 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Dec 14 12:46:01 2016 New Revision: 289685 URL: http://llvm.org/viewvc/llvm-project?rev=289685=rev Log: [Driver] Add tests for enabled static analyzer checkers. The driver passes flags to cc1 that enable various checkers based on the target triple. This commit adds

r289309 - [analyzer] Improve VirtualCallChecker diagnostics and move into optin package.

2016-12-09 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Dec 9 19:16:09 2016 New Revision: 289309 URL: http://llvm.org/viewvc/llvm-project?rev=289309=rev Log: [analyzer] Improve VirtualCallChecker diagnostics and move into optin package. The VirtualCallChecker is in alpha because its interprocedural diagnostics represent

r288922 - [analyzer] Fix typo in nullability checker diagnostic

2016-12-07 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Dec 7 11:36:27 2016 New Revision: 288922 URL: http://llvm.org/viewvc/llvm-project?rev=288922=rev Log: [analyzer] Fix typo in nullability checker diagnostic 'infered' --> 'inferred' Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp Modified:

Re: Crash in MallocChecker

2016-11-30 Thread Devin Coughlin via cfe-commits
+ Artem and Daniel, Thanks for the patch! This fix seems reasonable to me, although it would good to add the reproducer as test case! (tests/Analysis/malloc.cpp would be a fine place for it). Devin Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp

[PATCH] D26762: Add a method to obtain this SVal of a method that created given StackFrameCtx

2016-11-16 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for the patch! How does this differ from `getCXXThisVal()` on `CXXInstanceCall` and its subclasses in CallEvent.h? Can that be used instead? Or are there places where you need access to this without a CallEvent? Also: it seems like there are a lot of places

[PATCH] D26768: [analyzer] Improve VirtualCallChecker diagnostics and move out of alpha

2016-11-16 Thread Devin Coughlin via cfe-commits
dcoughlin created this revision. dcoughlin added reviewers: zaks.anna, NoQ. dcoughlin added subscribers: cfe-commits, alexfh. The VirtualCallChecker is in alpha because its interprocedural diagnostics represent the call path textually in the diagnostic message rather than with a path sensitive

r287105 - [www] Fix spelling error in checker release notes.

2016-11-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Nov 16 08:23:41 2016 New Revision: 287105 URL: http://llvm.org/viewvc/llvm-project?rev=287105=rev Log: [www] Fix spelling error in checker release notes. Modified: cfe/trunk/www/analyzer/release_notes.html Modified: cfe/trunk/www/analyzer/release_notes.html URL:

r287063 - [www] Update analyzer website for release of checker-279

2016-11-15 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Nov 15 18:47:56 2016 New Revision: 287063 URL: http://llvm.org/viewvc/llvm-project?rev=287063=rev Log: [www] Update analyzer website for release of checker-279 Modified: cfe/trunk/www/analyzer/index.html cfe/trunk/www/analyzer/latest_checker.html.incl

r287001 - [analyzer] Add check for when block is called with too few arguments.

2016-11-15 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Nov 15 12:40:46 2016 New Revision: 287001 URL: http://llvm.org/viewvc/llvm-project?rev=287001=rev Log: [analyzer] Add check for when block is called with too few arguments. The CallAndMessageChecker has an existing check for when a function pointer is called with too

[PATCH] D26644: [analyzer] Rename assumeWithinInclusiveRange*()

2016-11-14 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. LGTM, other then some indentation issues for arguments and parameters after the rename. Please fix those and commit! And thanks for splitting this up. Comment at:

r286901 - [analyzer] Fix crash in NullabilityChecker calling block with too few arguments

2016-11-14 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Mon Nov 14 16:46:02 2016 New Revision: 286901 URL: http://llvm.org/viewvc/llvm-project?rev=286901=rev Log: [analyzer] Fix crash in NullabilityChecker calling block with too few arguments Fix a crash when checking parameter nullability on a block invocation with fewer

r286700 - [analyzer] Update 'Automated' to 'Automatic' from r286694.

2016-11-11 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Nov 11 19:50:04 2016 New Revision: 286700 URL: http://llvm.org/viewvc/llvm-project?rev=286700=rev Log: [analyzer] Update 'Automated' to 'Automatic' from r286694. ARC is 'Automatic Reference Counting' and not 'Automated Reference Counting'. Modified:

r286697 - [analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.

2016-11-11 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Nov 11 19:23:01 2016 New Revision: 286697 URL: http://llvm.org/viewvc/llvm-project?rev=286697=rev Log: [analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name. The name of the NullableReturnedFromNonnullChecker in Checkers.td was accidentally

r286694 - [analyzer] Improve misleading RetainCountChcker diagnostic under ARC

2016-11-11 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Nov 11 19:03:06 2016 New Revision: 286694 URL: http://llvm.org/viewvc/llvm-project?rev=286694=rev Log: [analyzer] Improve misleading RetainCountChcker diagnostic under ARC Under automated reference counting the analyzer treats a methods -- even those starting with

r286633 - [analyzer] Teach RetainCountChecker about VTCompressionSessionEncodeFrame()

2016-11-11 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Fri Nov 11 15:31:38 2016 New Revision: 286633 URL: http://llvm.org/viewvc/llvm-project?rev=286633=rev Log: [analyzer] Teach RetainCountChecker about VTCompressionSessionEncodeFrame() The context argument passed to VideoToolbox's VTCompressionSessionEncodeFrame() function

[PATCH] D26340: [analyzer] Add SpinLockChecker for the Magenta kernel

2016-11-09 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D26340#590882, @khazem wrote: > Devin, based on Artem's review of the other checker that I have posted [1] I > am wondering about merging both this SpinLockChecker and the MutexChecker > into PthreadLockChecker. Do you think it is still

[PATCH] D26340: [analyzer] Add SpinLockChecker for the Magenta kernel

2016-11-09 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for adding the path notes and adopting CallDescription. I've added some additional comments inline, which are mostly minor nits. Two additional important changes -- and I should have noted these in the initial review -- is that it would be good to remove a

Re: [clang-tools-extra] r286222 - [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them

2016-11-09 Thread Devin Coughlin via cfe-commits
+ Anna, Alexander, and Artem. > On Nov 9, 2016, at 10:50 AM, Devin Coughlin via cfe-commits > <cfe-commits@lists.llvm.org> wrote: > > >> On Nov 8, 2016, at 9:44 AM, Malcolm Parsons <malcolm.pars...@gmail.com> >> wrote: >> >> On 8 November 2016

Re: [clang-tools-extra] r286222 - [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them

2016-11-09 Thread Devin Coughlin via cfe-commits
> On Nov 8, 2016, at 9:44 AM, Malcolm Parsons wrote: > > On 8 November 2016 at 16:59, Alexander Kornienko wrote: >> On Nov 8, 2016 2:11 AM, "Malcolm Parsons" wrote: >>> Oh, I was using

[PATCH] D26373: [analyzer] Provide Contains() on ImmutableMap program state partial trait.

2016-11-08 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D26373#589614, @ddcc wrote: > Even though there isn't a performance difference, I think it is semantically > clearer since it is explicit that the value is unneeded. Makes sense to me! https://reviews.llvm.org/D26373

[PATCH] D26373: [analyzer] Provide Contains() on ImmutableMap program state partial trait.

2016-11-07 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. This seems reasonable and it looks good to me (as long as there is a later patch coming that calls the new method). However: is there a situation where `Contains()` is preferable to

[PATCH] D26340: [analyzer] Add SpinLockChecker for the Magenta kernel

2016-11-07 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for upstreaming this! (And it was great to meet you at the developer conference.) Comment at: lib/StaticAnalyzer/Checkers/SpinLockChecker.cpp:61 + +const ErrorCategoryStr LockInfo::LockErrCategory("Lock Error"); +const FunctionNameStr

[PATCH] D18073: Add memory allocating functions

2016-11-06 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for iterating on the patch! Some comments in-line. Comment at: llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:569 + // allocating functions initialized to nullptr, which will never equal a + //non-null IdentifierInfo*, and

r285759 - [analyzer] Fix capitalization in ObjCSuperDealloc checker diagnostic.

2016-11-01 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Tue Nov 1 17:16:39 2016 New Revision: 285759 URL: http://llvm.org/viewvc/llvm-project?rev=285759=rev Log: [analyzer] Fix capitalization in ObjCSuperDealloc checker diagnostic. Change "use of 'self'..." to "Use of 'self'...". The convention is to start diagnostics with a

[PATCH] D26061: [analyzer] Refactor and simplify SimpleConstraintManager

2016-10-31 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for the patch! Would it be possible to split this up into several patches? I think it is important to separate the interface layering changes from the formatting changes, renaming changes, and minor optimization changes. This will make the patches easier to

[PATCH] D26159: [analyzer] MacOSXAPIChecker: Improve warning messages for __block vars in dispatch_once().

2016-10-31 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. LGTM. We should probably be warning any time the address of a block variable is taken since the address is not stable -- but that's a job for a different checker or possibly even Sema.

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-27 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. LGTM. Comment at: test/Analysis/number-object-conversion.m:98 + +#define NULL_INSIDE_MACRO NULL +void test_NULL_inside_macro(NSNumber *p) { This is great! And a good catch.

[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

2016-10-25 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Are the parameter types actually needed? I think in general the rest of the analyzer uses arity alone. Is the idea to allow for overloads in C++? If so, then I think this equivalent-up-to-size-and-sign approach will disallow those overloads.

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94 + else if (isa(RS)) { +// FIXME: Presence of an IVar region has priority over this branch, because +// ObjC objects are on the heap even if the core doesn't realize this.

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:92 + else if (isa(RS)) +os << " heap allocated memory"; + else if (isa(RS)) { "heap allocated" --> "heap-allocated" Comment at:

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-24 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && kromanenkov wrote: >

[PATCH] D25876: [analyzer] Report CFNumberGetValue API misuse

2016-10-21 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. LGTM! https://reviews.llvm.org/D25876 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25876: [analyzer] Report CFNumberGetValue API misuse

2016-10-21 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: test/Analysis/CFNumber.c:39 + unsigned char scalar = 0; + CFNumberGetValue(x, kCFNumberSInt16Type, ); // expected-warning{{A CFNumber object that represents a 16 bit integer is used to initialize an 8 bit integer. 8 bits of the

[PATCH] D20811: [analyzer] Model some library functions

2016-10-21 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This looks great! Comment at: lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:694 +INVALIDATION_APPROACH(EvalCallAsPure)) + CASE // Is certainly uppercase. +

[PATCH] D20811: [analyzer] Model some library functions

2016-10-20 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D20811#575521, @NoQ wrote: > I thought to give it a pause to take a fresh look at how to arrange the > macro-hints in the summaries. > > Maybe something like that: > > CASE > ARGUMENT_CONDITION(ARG_NO(0), OutOfRange) >

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && dcoughlin wrote: > dcoughlin

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && dcoughlin wrote: > I don't

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && I don't think pattern

r284351 - Revert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations""

2016-10-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Oct 16 17:19:03 2016 New Revision: 284351 URL: http://llvm.org/viewvc/llvm-project?rev=284351=rev Log: Revert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations"" This reverts commit r284340 to reapply r284335. The bot breakage was due

Re: r284335 - [analyzer] Make MallocChecker more robust against custom redeclarations

2016-10-16 Thread Devin Coughlin via cfe-commits
> On Oct 16, 2016, at 12:53 PM, Renato Golin wrote: > > On 16 October 2016 at 20:36, Devin Coughlin wrote: >> Reverted in r284340. > > Hi Devin, > > Sometimes Clang patches break on stage 2 or test-suite, but this is > not the case. I dug deeper

Re: r284335 - [analyzer] Make MallocChecker more robust against custom redeclarations

2016-10-16 Thread Devin Coughlin via cfe-commits
> On Oct 16, 2016, at 12:12 PM, Devin Coughlin via cfe-commits > <cfe-commits@lists.llvm.org> wrote: > >> >> On Oct 16, 2016, at 12:04 PM, Renato Golin <renato.go...@linaro.org> wrote: >> >> On 16 October 2016 at 18:26, Devin Coughlin via cfe-

r284340 - Revert "[analyzer] Make MallocChecker more robust against custom redeclarations"

2016-10-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Oct 16 14:26:07 2016 New Revision: 284340 URL: http://llvm.org/viewvc/llvm-project?rev=284340=rev Log: Revert "[analyzer] Make MallocChecker more robust against custom redeclarations" This reverts commit r284335. It appears to be causing test-suite compile-time and

Re: r284335 - [analyzer] Make MallocChecker more robust against custom redeclarations

2016-10-16 Thread Devin Coughlin via cfe-commits
> On Oct 16, 2016, at 12:04 PM, Renato Golin <renato.go...@linaro.org> wrote: > > On 16 October 2016 at 18:26, Devin Coughlin via cfe-commits > <cfe-commits@lists.llvm.org> wrote: >> Author: dcoughlin >> Date: Sun Oct 16 12:26:06 2016 >> New Revision:

r284335 - [analyzer] Make MallocChecker more robust against custom redeclarations

2016-10-16 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Oct 16 12:26:06 2016 New Revision: 284335 URL: http://llvm.org/viewvc/llvm-project?rev=284335=rev Log: [analyzer] Make MallocChecker more robust against custom redeclarations Add additional checking to MallocChecker to avoid crashing when memory routines have

r284317 - Revert "[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker""

2016-10-15 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sat Oct 15 19:30:08 2016 New Revision: 284317 URL: http://llvm.org/viewvc/llvm-project?rev=284317=rev Log: Revert "[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"" Revert: r283662: [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-14 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D25326#569061, @danielmarjamaki wrote: > > You could also try to add a canary with clang analyzer eval after the if > > statement to force the test to fail if we do add this symbolic reasoning. > > sounds good. sorry but I don't see how to

r284084 - [analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS

2016-10-12 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Oct 12 18:57:05 2016 New Revision: 284084 URL: http://llvm.org/viewvc/llvm-project?rev=284084=rev Log: [analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code for

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-10 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D25326#565919, @danielmarjamaki wrote: > In https://reviews.llvm.org/D25326#564584, @zaks.anna wrote: > > > Please, fix the style issues before committing. > > > Would it be ok to run clang-format on some files to clean up the formatting? >

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-10 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: test/Analysis/unreachable-code-path.c:201 +static int inlineFunction(const int i) { + if (table[i] != 0) +return 1; danielmarjamaki wrote: > NoQ wrote: > > a.sidorin wrote: > > > I have a small question. Is it

[PATCH] D25326: [StaticAnalyser] Don't merge different returns in ExplodedGraph

2016-10-07 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Can you also add a test that tests this more directly (i.e., with clang_analyzer_warnIfReached). I don't think it is good to have the only test for this core coverage issue to be in tests for an alpha checker. Adding the direct test would also make it easier to track

[PATCH] D23236: When ARC is enabled, no warning will be generated when a method1. Returns 'nil' in a method that is attributed to return a 'nonnull'2. The return-statement is a ConditionalOperator, wh

2016-10-06 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. I left out the example I was describing above for 'InitializationSequence::Perform()': @interface Bar - (nonnull Bar *)method; @end @implementation Bar - (Bar *)method { return 0; } @end https://reviews.llvm.org/D23236

[PATCH] D23236: When ARC is enabled, no warning will be generated when a method1. Returns 'nil' in a method that is attributed to return a 'nonnull'2. The return-statement is a ConditionalOperator, wh

2016-10-06 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D23236#561467, @parallaxe wrote: > In https://reviews.llvm.org/D23236#557898, @dcoughlin wrote: > > > Upon reflection, I don't think this is the right approach. > > > > Desugaring any AttributedType in the return type seems like a really, >

[PATCH] D23236: When ARC is enabled, no warning will be generated when a method1. Returns 'nil' in a method that is attributed to return a 'nonnull'2. The return-statement is a ConditionalOperator, wh

2016-09-30 Thread Devin Coughlin via cfe-commits
dcoughlin requested changes to this revision. dcoughlin added a comment. This revision now requires changes to proceed. Upon reflection, I don't think this is the right approach. Desugaring any AttributedType in the return type seems like a really, really big hammer and could be an unexpected

[PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-30 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Sorry, missed this patch. I think it would good to add a test to make sure we do warn when the var decl has an initializer, since that will not be executed. void varDecl(int X) { switch (X) { int A = 12; // We do want a warning here, since the variable

[PATCH] D24759: [RFC][StaticAnalyser] fix unreachable code false positives when block numbers mismatch

2016-09-30 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. LGTM. Please commit! https://reviews.llvm.org/D24759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D23236: When ARC is enabled, no warning will be generated when a method1. Returns 'nil' in a method that is attributed to return a 'nonnull'2. The return-statement is a ConditionalOperator

2016-09-27 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. @parallaxe Do you need someone to commit this for you? https://reviews.llvm.org/D23236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D23236: When ARC is enabled, no warning will be generated when a method1. Returns 'nil' in a method that is attributed to return a 'nonnull'2. The return-statement is a ConditionalOperator

2016-09-26 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. LGTM. https://reviews.llvm.org/D23236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24759: [RFC][StaticAnalyser] fix unreachable code false positives when block numbers mismatch

2016-09-23 Thread Devin Coughlin via cfe-commits
dcoughlin requested changes to this revision. dcoughlin added a reviewer: dcoughlin. This revision now requires changes to proceed. Comment at: lib/Analysis/CFG.cpp:2986 @@ -2985,3 +2985,1 @@ -if (!KnownVal.isFalse()) { - // Add an intermediate block between the

Re: [PATCH] D24792: [analyzer] Fix crash in RetainCountChecker::checkEndFunction

2016-09-21 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. I suspect I introduced this regression in r264687. Repository: rL LLVM https://reviews.llvm.org/D24792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24759: [RFC][StaticAnalyser] fix unreachable code false positives when block numbers mismatch

2016-09-20 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Here is the discussion on cfe-dev. http://lists.llvm.org/pipermail/cfe-dev/2016-September/050800.html What's going on is that the path-sensitive unreachable code checker traverses blocks in the unoptimized CFG and emits a diagnostic if a block in that CFG is not

Re: [PATCH] D24759: [RFC][StaticAnalyser] fix unreachable code false positives when block numbers mismatch

2016-09-20 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. @danielmarjamaki I see what you mean -- thanks for providing the patch. I don't think this is the right approach. It should be sufficient to reason about blocks and not individual statements; further some blocks may be non-empty but not have any statements. Instead,

r281880 - [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

2016-09-18 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Sun Sep 18 20:36:40 2016 New Revision: 281880 URL: http://llvm.org/viewvc/llvm-project?rev=281880=rev Log: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv Treat lines in projectMap.csv that start with '#' as comments. This enables a workflow where

Re: [PATCH] D24709: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

2016-09-18 Thread Devin Coughlin via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281880: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv (authored by dcoughlin). Changed prior to commit: https://reviews.llvm.org/D24709?vs=71757=71766#toc Repository: rL LLVM

[PATCH] D24709: [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

2016-09-18 Thread Devin Coughlin via cfe-commits
dcoughlin created this revision. dcoughlin added reviewers: zaks.anna, NoQ. dcoughlin added a subscriber: cfe-commits. Treat lines in projectMap.csv that start with '#' as comments. This enables a workflow where projects can be temporarily disabled with a comment describing when they should be

Re: [PATCH] D24278: [analyzer] Extend bug reports with extra notes.

2016-09-16 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. This is awesome! I have some minor comments on the dealloc notes. It is also fine to remove them entirely; we can add them in a later commit. Comment at: lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp:604 @@ -588,1 +603,3 @@ +

Re: [PATCH] D20811: [analyzer] Model some library functions

2016-09-16 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. In https://reviews.llvm.org/D20811#544981, @NoQ wrote: > Hmm, what about > > CONSTRAIN > ARGUMENT_VALUE(0, WithinRange) > RANGE('0', '9') > RANGE('A', 'Z') > RANGE('a', 'z') > END_ARGUMENT_VALUE > RETURN_VALUE(OutOfRange) >

Re: [PATCH] D20811: [analyzer] Model some library functions

2016-09-16 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. I think this is much clearer! That said, now that I look at it with 'POSTCONDITION' alone I don't think it is clear that the provided value describes the return value. What do you think about renaming it 'RETURN_VALUE'? Or adding back the RET_VAL I asked you about

Re: [PATCH] D20811: [analyzer] Model some library functions

2016-09-15 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Thanks for adding the macros. I've provided some feedback inline. I think a good rule of thumb for readability is: suppose you are a maintainer and need to add a summary for a new function. Can you copy the the summary for an existing function and figure out what

Re: [cfe-dev] [Static Analyzer] Retain count checker does not warn about parameters that might leak

2016-09-15 Thread Devin Coughlin via cfe-commits
- cfe-dev, + cfe-commits Hi Tobias, This is a great start. Thanks for the patch! > Not sure I know how to use the analyzer config flags yet. My patch > currently also still causes a segfault on Analysis/retain-release.m The segfault is because the diagnostics machinery expects a declaration

Re: [PATCH] D24470: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

2016-09-14 Thread Devin Coughlin via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281516: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py (authored by dcoughlin). Changed prior to commit: https://reviews.llvm.org/D24470?vs=71046=71401#toc Repository: rL

r281516 - [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

2016-09-14 Thread Devin Coughlin via cfe-commits
Author: dcoughlin Date: Wed Sep 14 13:14:11 2016 New Revision: 281516 URL: http://llvm.org/viewvc/llvm-project?rev=281516=rev Log: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py Remove the relative path hack in scan-build-py that converts a fully qualified directory name

[PATCH] D24470: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

2016-09-12 Thread Devin Coughlin via cfe-commits
dcoughlin created this revision. dcoughlin added a reviewer: rizsotto.mailinglist. dcoughlin added a subscriber: cfe-commits. Remove the relative path hack in scan-build-py that converts a fully qualified directory name and a fully qualified file path to a relative path before running the

Re: [PATCH] D23963: [analyzer] pr28449 - Move literal rvalue construction away from RegionStore.

2016-09-09 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. I agree that it is weird that region store modifies the value it was asked to bind and over all this seems like the right approach. My big concern with this patch is that the logic that looks whether an lval is being stored into a non-reference location and

  1   2   3   4   >