Daniel Marjamaki
3d8d6ed01f
[analyzer] Clarify 'uninitialized function argument' messages
...
Differential Revision: https://reviews.llvm.org/D30341
llvm-svn: 297283
2017-03-08 15:22:24 +00:00
Dominic Chen
184c6242fa
Reland 4: [analyzer] NFC: Update test infrastructure to support multiple 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
2017-03-03 18:02:02 +00:00
Dominic Chen
09d66f7528
Revert "Reland 3: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"
...
This reverts commit ea36f1406e1f36bf456c3f3929839b024128e468.
llvm-svn: 296841
2017-03-02 23:30:53 +00:00
Dominic Chen
feaf9ff5ee
Reland 3: [analyzer] NFC: Update test infrastructure to support multiple 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
2017-03-02 23:05:45 +00:00
Dominic Chen
4a90bf8c3f
Revert "Reland 2: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"
...
This reverts commit f93343c099fff646a2314cc7f4925833708298b1.
llvm-svn: 296836
2017-03-02 22:58:06 +00:00
Dominic Chen
1cb0256a3c
Reland 2: [analyzer] NFC: Update test infrastructure to support multiple 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
2017-03-02 22:45:24 +00:00
Dominic Chen
00355a51d0
Revert "Reland: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"
...
This reverts commit 1b28d0b10e1c8feccb971abb6ef7a18bee589830.
llvm-svn: 296422
2017-02-28 01:50:23 +00:00
Dominic Chen
59cd893320
Reland: [analyzer] NFC: Update test infrastructure to support multiple 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
2017-02-28 00:02:36 +00:00
Dominic Chen
8589e10c30
Revert "[analyzer] NFC: Update test infrastructure to support multiple constraint managers"
...
This reverts commit 8e7780b9e59ddaad1800baf533058d2c064d4787.
llvm-svn: 296317
2017-02-27 03:29:25 +00:00
Dominic Chen
02064a3076
[analyzer] NFC: Update test infrastructure to support multiple 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: 296312
2017-02-27 02:36:15 +00:00
Dominic Chen
1a154e082c
[analyzer] Drop explicit mention of range constraint solver
...
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
2016-12-01 17:06:39 +00:00
Anna Zaks
c9f16fe48c
[analyzer] Don't report null dereferences on address_space annotated memory
...
llvm-svn: 256885
2016-01-06 00:32:49 +00:00
Ted Kremenek
776409286b
[analyzer] Remove IdempotentOperations checker.
...
This checker has not been updated to work with interprocedural analysis,
and actually contains both logical correctness issues but also
memory bugs. We can resuscitate it from version control once there
is focused interest in making it a real viable checker again.
llvm-svn: 198476
2014-01-04 05:52:11 +00:00
Alp Toker
d473363876
Correct hyphenations in comments and assert messages
...
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.
llvm-svn: 196466
2013-12-05 04:47:09 +00:00
Ted Kremenek
722398f1d4
Fix analyzer tests.
...
llvm-svn: 162588
2012-08-24 20:39:55 +00:00
Chad Rosier
d1956e46dd
[frontend] Don't allow a mapping to a warning override an error/fatal mapping.
...
rdar://10736625
llvm-svn: 149662
2012-02-03 01:49:51 +00:00
Ted Kremenek
b9ff6b2302
Reenable DeadStoresChecker under --analyze, and move the IdempotentOperationsChecker to the 'experimental' category. Fixes <rdar://problem/10146347>.
...
llvm-svn: 148533
2012-01-20 06:00:17 +00:00
Anna Zaks
5f847144d1
[analyzer] Do not invalidate arguments when the parameter's
...
type is a pointer to const. (radar://10595327)
The regions corresponding to the pointer and reference arguments to
a function get invalidated by the calls since a function call can
possibly modify the pointed to data. With this change, we are not going
to invalidate the data if the argument is a pointer to const. This
change makes the analyzer more optimistic in reporting errors.
(Support for C, C++ and Obj C)
llvm-svn: 147002
2011-12-20 22:35:30 +00:00
Anna Zaks
1df54a8bc8
[analyzer] The compiler warning was disabling the analyzer in this test.
...
llvm-svn: 144946
2011-11-18 00:45:20 +00:00
Anna Zaks
8d4c8e1498
[analyzer] Add -analyzer-purge option which can take on multiple values, remove -analyzer-purge=none. (Small refactor as well: move the work of constructing AnalysisManager from the callers to the class itself.)
...
llvm-svn: 140838
2011-09-30 02:03:00 +00:00
Ted Kremenek
3f955e6d89
[analyzer] rename all experimental checker packages to have 'experimental' be the common root package.
...
llvm-svn: 136835
2011-08-03 23:14:55 +00:00
Ted Kremenek
73665188fc
Really remove FlatStoreManager and BasicStoreManager, this time from the driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge.
...
llvm-svn: 136422
2011-07-28 23:08:16 +00:00
Ted Kremenek
a4a57c10da
Re-enable the IdempotentOperations checker for --analyze, and put it and the DeadStores checker into the "deadcode" group.
...
llvm-svn: 127531
2011-03-12 06:14:28 +00:00
Argyrios Kyrtzidis
9eb02dfa89
[analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.
...
llvm-svn: 126676
2011-02-28 19:49:42 +00:00
Argyrios Kyrtzidis
6fff2e3d36
[analyzer] Migrate AttrNonNullChecker to CheckerV2.
...
llvm-svn: 126623
2011-02-28 01:28:01 +00:00
Argyrios Kyrtzidis
b388f77ad9
[analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't have any checkers associated with it anymore.
...
llvm-svn: 126440
2011-02-24 21:43:08 +00:00
Argyrios Kyrtzidis
b2400924d9
[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.
...
llvm-svn: 125611
2011-02-15 22:55:14 +00:00
Ted Kremenek
731310e13e
Tweak null dereference checker to give better diagnostics for null dereferences resulting from array accesses.
...
llvm-svn: 117334
2010-10-26 00:06:13 +00:00
Ted Kremenek
5cdaeaaa1d
Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call.
...
Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved
llvm-svn: 113554
2010-09-09 22:51:55 +00:00
John McCall
83556c1a80
Put the tautological-comparison-of-unsigned-against-zero warnings in
...
-Wtautological-compare instead of -Wsign-compare, which also implies turning
them on by default.
Restoration of r112877.
llvm-svn: 113334
2010-09-08 02:01:27 +00:00
John McCall
310083c3e3
sabre points out that the timing here is pretty pessimal; I'll retry the
...
experiment in a few days.
llvm-svn: 112882
2010-09-02 22:27:38 +00:00
John McCall
25f7aa8158
Experimentally move the tautological comparison warnings from -Wsign-compare
...
to -Wtautological-compare. This implies that they're now on by default.
If this causes chaos, I'll figure something else out.
llvm-svn: 112877
2010-09-02 22:18:59 +00:00
Tom Care
71cc9d886a
Added checking of (x == x) and (x != x) to IdempotentOperationChecker and updated test cases flagged by it.
...
llvm-svn: 112313
2010-08-27 22:50:47 +00:00
Tom Care
98e679508d
Enabled relaxed LiveVariables analysis in the path-sensitive engine to increase the coverage of bugs. Primarily affects IdempotentOperationChecker.
...
- Migrated a temporarily separated test back to its original file (bug has been fixed, null-deref-ps-temp.c -> null-deref-ps.c)
- Changed SymbolManager to use relaxed LiveVariables
- Updated several test cases that the IdempotentOperationChecker class now flags
- Added test case to test relaxed LiveVariables use by the IdempotentOperationChecker
llvm-svn: 112312
2010-08-27 22:46:32 +00:00
Tom Care
b9933f365e
Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
...
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified
llvm-svn: 111426
2010-08-18 21:17:24 +00:00
Tom Care
f8a9863df9
Improved IdempotentOperationChecker false positives and false negatives.
...
- Unfinished analysis may still report valid warnings if the path was completely analyzed
- New 'CanVary' heuristic to recursively determine if a subexpression has a varying element
- Updated test cases, including one known bug
- Exposed GRCoreEngine through GRExprEngine
llvm-svn: 110970
2010-08-12 22:45:47 +00:00
Ted Kremenek
83b598c14f
Finesse 'idempotent operations' analyzer issues to include the opcode of the binary operator for clearer error reporting. Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same.
...
llvm-svn: 109527
2010-07-27 18:49:08 +00:00
Tom Care
826e6b4023
Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
...
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings
llvm-svn: 108550
2010-07-16 20:41:41 +00:00
Chris Lattner
33919e7450
fix PR7280 by making the warning on code like this:
...
int test1() {
return;
}
default to an error.
llvm-svn: 108108
2010-07-11 23:34:02 +00:00
Jordy Rose
3d85888d4e
If a nonnull argument evaluates to UnknownVal, don't warn (and don't crash).
...
llvm-svn: 106456
2010-06-21 20:08:28 +00:00
Douglas Gregor
c68e140657
Improve diagnostics when we fail to convert from a source type to a
...
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as
t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~
We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:
t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~
Fixes <rdar://problem/7447179>.
llvm-svn: 100832
2010-04-09 00:35:39 +00:00
Ted Kremenek
bb6f5af4a4
Tweak null dereference diagnostics to give clearer diagnostics when
...
a null dereference results from a field access.
llvm-svn: 99236
2010-03-23 01:11:38 +00:00
Ted Kremenek
2f2692f8ca
Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.
...
llvm-svn: 95348
2010-02-05 02:06:54 +00:00
Daniel Dunbar
8fbe78f6fc
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
...
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Zhongxing Xu
27f686f8ec
Replace clang-cc with clang -cc1.
...
llvm-svn: 91272
2009-12-14 06:34:20 +00:00
Ted Kremenek
c0229557dd
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced. Addresses <rdar://problem/7039161>.
...
llvm-svn: 89726
2009-11-24 01:33:10 +00:00
Daniel Dunbar
484afa2d3b
Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm: 🆑 :init(true) arguments.
...
llvm-svn: 89315
2009-11-19 04:55:23 +00:00
Ted Kremenek
4ef13f8ac9
Add clang-cc option "--analyzer-experimental-internal-checks". This
...
option enables new "internal" checks that will eventually be turned on
by default but still require broader testing.
llvm-svn: 88671
2009-11-13 18:46:29 +00:00
Daniel Dunbar
8b57697954
Eliminate &&s in tests.
...
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.
llvm-svn: 86430
2009-11-08 01:45:36 +00:00
Ted Kremenek
196d2a0095
Remove test case's dependency on platform headers.
...
llvm-svn: 83030
2009-09-28 23:54:40 +00:00