summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/array-struct-region.c
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by defaultGeorge Karpenkov2018-08-291-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D51251 llvm-svn: 340963
* Reland 4: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen2017-03-031-1/+1
| | | | | | | | | | | | | | constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296895
* Revert "Reland 3: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen2017-03-021-1/+1
| | | | | | | | multiple constraint managers" This reverts commit ea36f1406e1f36bf456c3f3929839b024128e468. llvm-svn: 296841
* Reland 3: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen2017-03-021-1/+1
| | | | | | | | | | | | | | constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296837
* Revert "Reland 2: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen2017-03-021-1/+1
| | | | | | | | multiple constraint managers" This reverts commit f93343c099fff646a2314cc7f4925833708298b1. llvm-svn: 296836
* Reland 2: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen2017-03-021-1/+1
| | | | | | | | | | | | | | constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296835
* Revert "Reland: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen2017-02-281-1/+1
| | | | | | | | multiple constraint managers" This reverts commit 1b28d0b10e1c8feccb971abb6ef7a18bee589830. llvm-svn: 296422
* Reland: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen2017-02-281-1/+1
| | | | | | | | | | | | | | constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296414
* Revert "[analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen2017-02-271-1/+1
| | | | | | | | constraint managers" This reverts commit 8e7780b9e59ddaad1800baf533058d2c064d4787. llvm-svn: 296317
* [analyzer] NFC: Update test infrastructure to support multiple constraint ↵Dominic Chen2017-02-271-1/+1
| | | | | | | | | | | | | | managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296312
* [analyzer] Drop explicit mention of range constraint solverDominic Chen2016-12-011-1/+1
| | | | | | | | | | | | Summary: The basic constraint solver was dropped in rL162384, leaving the range constraint solver as the default and only constraint solver. Explicitly specifying it is unnecessary, and makes it difficult to test with other solver backends. Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26694 llvm-svn: 288372
* [analyzer] Tighten up safety in the use of lazy bindings.Jordan Rose2013-02-211-0/+7
| | | | | | | | | | | | | | | - When deciding if we can reuse a lazy binding, make sure to check if there are additional bindings in the sub-region. - When reading from a lazy binding, don't accidentally strip off casts or base object regions. This slows down lazy binding reading a bit but is necessary for type sanity when treating one class as another. A bit of minor refactoring allowed these two checks to be unified in a nice early-return-using helper function. <rdar://problem/13239840> llvm-svn: 175703
* [analyzer] Reuse a LazyCompoundVal if its type matches the new region.Jordan Rose2013-02-011-0/+44
| | | | | | | | | | | | | | | | | This allows us to keep from chaining LazyCompoundVals in cases like this: CGRect r = CGRectMake(0, 0, 640, 480); CGRect r2 = r; CGRect r3 = r2; Previously we only made this optimization if the struct did not begin with an aggregate member, to make sure that we weren't picking up an LCV for the first field of the struct. But since LazyCompoundVals are typed, we can make that inference directly by comparing types. This is a pure optimization; the test changes are to guard against possible future regressions. llvm-svn: 174211
* [analyzer] Fix a bug in region store that lead to undefined value falseAnna Zaks2013-01-311-1/+13
| | | | | | | | | | positives. The includeSuffix was only set on the first iteration through the function, resulting in invalid regions being produced by getLazyBinding (ex: zoomRegion.y). llvm-svn: 174016
* [analyzer] When invalidating symbolic offset regions, take fields into account.Jordan Rose2012-11-101-0/+107
| | | | | | | | | | | | | | | | | | | Previously, RegionStore was being VERY conservative in saying that because p[i].x and p[i].y have a concrete base region of 'p', they might overlap. Now, we check the chain of fields back up to the base object and check if they match. This only kicks in when dealing with symbolic offset regions because RegionStore's "base+offset" representation of concrete offset regions loses all information about fields. In cases where all offsets are concrete (s.x and s.y), RegionStore will already do the right thing, but mixing concrete and symbolic offsets can cause bindings to be invalidated that are known to not overlap (e.g. p[0].x and p[i].y). This additional refinement is tracked by <rdar://problem/12676180>. <rdar://problem/12530149> llvm-svn: 167654
* Fix analyzer tests.Ted Kremenek2012-08-241-1/+1
| | | | llvm-svn: 162588
* Remove BasicConstraintManager. It hasn't been in active service for a while.Ted Kremenek2012-08-221-1/+0
| | | | | | | | As part of this change, I discovered that a few of our tests were not testing the RangeConstraintManager. Luckily all of those passed when I moved them over to use that constraint manager. llvm-svn: 162384
* [analyzer] -analyzer-ipa=inlining is now the default. Remove it from tests.Jordan Rose2012-08-211-2/+2
| | | | | | | | | | | | | The actual change here is a little more complicated than the summary above. What we want to do is have our generic inlining tests run under whatever mode is the default. However, there are some tests that depend on the presence of C++ inlining, which still has some rough edges. These tests have been explicitly marked as -analyzer-ipa=inlining in preparation for a new mode that limits inlining to C functions and blocks. This will be the default until the false positives for C++ have been brought down to manageable levels. llvm-svn: 162317
* [analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.Jordan Rose2012-08-081-0/+92
| | | | | | | | | | | | | | | | | RegionStore currently uses a (Region, Offset) pair to describe the locations of memory bindings. However, this representation breaks down when we have regions like 'array[index]', where 'index' is unknown. We used to store this as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC). Furthermore, ProgramState::scanReachableSymbols depended on the existence of a sub-region map, but RegionStore's implementation doesn't provide for such a thing. Moving the store-traversing logic of scanReachableSymbols into the StoreManager allows us to eliminate the notion of SubRegionMap altogether. This fixes some particularly awkward broken test cases, now in array-struct-region.c. llvm-svn: 161510
* [analyzer] Fix mis-committed test. No functionality change.Jordan Rose2012-07-061-2/+2
| | | | llvm-svn: 159869
* [analyzer] Be careful about LazyCompoundVals, which may be for the first field.Jordan Rose2012-07-061-2/+37
| | | | | | | | | | | | | | | We use LazyCompoundVals to avoid copying the contents of structs and arrays around in the store, and when we need to pass a struct around that already has a LazyCompoundVal we just use the original one. However, it's possible that the first field of a struct may have a LazyCompoundVal of its own, and we currently can't distinguish a LazyCompoundVal for the first element of a struct from a LazyCompoundVal for the entire struct. In this case we should just drop the optimization and make a new LazyCompoundVal that encompasses the old one. PR13264 / <rdar://problem/11802440> llvm-svn: 159866
* [analyzer] Convert many existing tests to use clang_analyzer_eval.Jordy Rose2012-05-161-19/+18
| | | | llvm-svn: 156920
* Improve some of the conversion warnings to fire on conversion to bool.David Blaikie2012-05-151-2/+2
| | | | | | | | | | | Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. llvm-svn: 156826
* [analyzer] Test case: p->x is the same as p[0].x. (PR7297)Jordy Rose2012-05-121-0/+13
| | | | llvm-svn: 156720
* Enable warn_impcast_literal_float_to_integer by default.David Blaikie2012-04-051-2/+2
| | | | | | | | | | | | | | | | | This diagnostic seems to be production ready, it's just an oversight that it wasn't turned on by default. The test changes are a bit of a mixed bag. Some tests that seemed like they clearly didn't need to use this behavior have been modified not to use it. Others that I couldn't be sure about, I added the necessary expected-warnings to. It's possible the diagnostic message could be improved to make it clearer that this warning can be suppressed by using a value that won't lose precision when converted to the target type (but can still be a floating point literal, such as "bool b = 1.0;"). llvm-svn: 154068
* [analyzer] rename all experimental checker packages to have 'experimental' ↵Ted Kremenek2011-08-031-2/+2
| | | | | | be the common root package. llvm-svn: 136835
* Rework checker "packages" and groups to be more hierarchical.Ted Kremenek2011-03-241-2/+2
| | | | llvm-svn: 128187
* [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best ↵Argyrios Kyrtzidis2011-02-281-2/+2
| | | | | | misnomer award. llvm-svn: 126676
* [analyzer] Remove '-analyzer-experimental-checks' flag.Argyrios Kyrtzidis2011-02-281-2/+2
| | | | llvm-svn: 126607
* [analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't ↵Argyrios Kyrtzidis2011-02-241-2/+2
| | | | | | have any checkers associated with it anymore. llvm-svn: 126440
* [analyzer] Use the new registration mechanism on some of the experimental ↵Argyrios Kyrtzidis2011-02-151-2/+2
| | | | | | | | | | | | | | | checks. These are: CStringChecker ChrootChecker MallocChecker PthreadLockChecker StreamChecker UnreachableCodeChecker MallocChecker creates implicit dependencies between checkers and needs to be handled differently. llvm-svn: 125598
* Handle nested compound values in BindArray for multidimensional arrays. ↵Jordy Rose2010-08-201-0/+22
| | | | | | Fixes PR7945. llvm-svn: 111602
* Move new test (that requires RegionStore) into its own file.Jordy Rose2010-07-291-0/+25
llvm-svn: 109736
OpenPOWER on IntegriCloud