History log of /external/clang/test/Analysis/idempotent-operations.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9b29f4fe3d0600edf6ba00d48f2d4f2b1984f247 16-Oct-2012 David Blaikie <dblaikie@gmail.com> Implement GCC's -Wint-to-pointer-cast.

This implementation doesn't warn on anything that GCC doesn't warn on with the
exception of templates specializations (GCC doesn't warn, Clang does). The
specific skipped cases (boolean, constant expressions, enums) are open for
debate/adjustment if anyone wants to demonstrate that GCC is being overly
conservative here. The only really obvious false positive I found was in the
Clang regression suite's MPI test - apparently MPI uses specific flag values in
pointer constants. (eg: #define FOO (void*)~0)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
791dd0a3f855b61ee97387dca67af86a1edff9f2 04-Sep-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Don't use makeIntVal to create a floating-point value.

SimpleSValBuilder processes a couple trivial identities, including 'x - x'
and 'x ^ x' (both 0). However, the former could appear with arguments of
floating-point type, and we weren't checking for that. This started
triggering an assert with r163069, which checks that a constant value is
actually going to be used as an integer or pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
cdc3a89d5de90b2299c56f4a46c3de590c5184d1 24-Aug-2012 Ted Kremenek <kremenek@apple.com> Fix analyzer tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
a8180e5a8795b4b80587662167dfc13646a494a1 20-Jan-2012 Ted Kremenek <kremenek@apple.com> Reenable DeadStoresChecker under --analyze, and move the IdempotentOperationsChecker to the 'experimental' category. Fixes <rdar://problem/10146347>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
3d33622cf50fe8bd2f10e71b9135bc5c74b1786e 12-Jan-2012 Ted Kremenek <kremenek@apple.com> Adjust set of default checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
1659acb9f93bab0c3e56d0c0f504d2ba41d6403e 05-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change test/Analysis/idempotent-operations.c to output the .plist file in the test output directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
9ede3076012c45cb5d2dcfdaf943279be0b3cd5c 12-Mar-2011 Ted Kremenek <kremenek@apple.com> Tweak test to hopefully appease FreeBSD buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
ade3195a201e16e989e9f93a568fb1806519077c 12-Mar-2011 Ted Kremenek <kremenek@apple.com> Re-enable the IdempotentOperations checker for --analyze, and put it and the DeadStores checker into the "deadcode" group.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
c4d2c9074be6eb2091086eddd6c8f052f3b245c8 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
c9f2e0f286500c7e747849b3aa9c0e67a4dc90d7 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on the IdempotentOperationChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
1bc80af703ceff3e92797f33c41634d327bf067a 16-Dec-2010 John McCall <rjmccall@apple.com> Do lvalue-to-rvalue conversions on the LHS of a shift operator.
Fixes rdar://problem/8776586.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
892697dd2287caf7c29aaaa82909b0e90b8b63fe 16-Dec-2010 Ted Kremenek <kremenek@apple.com> Start migration of static analyzer to using the
implicit lvalue-to-rvalue casts that John McCall
recently introduced. This causes a whole bunch
of logic in the analyzer for handling lvalues
to vanish. It does, however, raise a few issues
in the analyzer w.r.t to modeling various constructs
(e.g., field accesses to compound literals).

The .c/.m analysis test cases that fail are
due to a missing lvalue-to-rvalue cast that
will get introduced into the AST. The .cpp
failures were more than I could investigate in
one go, and the patch was already getting huge.
I have XFAILED some of these tests, and they
should obviously be further investigated.

Some highlights of this patch include:

- CFG no longer requires an lvalue bit for
CFGElements
- StackFrameContext doesn't need an 'asLValue'
flag
- The "VisitLValue" path from GRExprEngine has
been eliminated.

Besides the test case failures (XFAILed), there
are surely other bugs that are fallout from
this change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
74faec22ec84c54bcbd82cb6c48b72cb466b945f 29-Oct-2010 Ted Kremenek <kremenek@apple.com> Don't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false positives).

Fixes <rdar://problem/8601243>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
02282acd7a42d06a3178e3102d34a585bd82dd9f 15-Sep-2010 Ted Kremenek <kremenek@apple.com> Disallow the use of UnknownVal as the index for ElementRegions. UnknownVals can be used as
the index when the value evaluation isn't powerful enough. By creating ElementRegions with
UnknownVals as the index, this gives the false impression that they are the same element, when
they really aren't. This becomes really problematic when deriving symbols from these regions
(e.g., those representing the initial value of the index), since two different indices will
get the same symbol for their binding.

This fixes an issue with the idempotent operations checker that would cause two indices that
are clearly not the same to make it appear as if they always had the same value.

Fixes <rdar://problem/8431728>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
84c24ed29e0bb37fc06a584e0df5bdfbe49efc8f 07-Sep-2010 Tom Care <tom.care@uqconnect.edu.au> Re-enabled truncation/extension checking in IdempotentOperationChecker and added a test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
6216dc0c5b9071b4c10f78718a64ca916c00a384 30-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Adjusted the semantics of assign checking in IdempotentOperationChecker
- Fixed a regression where assigning '0' would be reported
- Changed the way self assignments are filtered to allow constant testing
- Added a test case for assign ops
- Fixed one test case where a function pointer was not considered constant
- Fixed test cases relating to 0 assignment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
6d0e6ce200aa06b06f0e9b493ed365bbe2982cee 28-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
967fea6cd9ae60ea31d27d440967990d2c705729 26-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Improved the handling of blocks and block variables in PseudoConstantAnalysis
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
ef52bcb606c73950139a775af61495f63fbc3603 24-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
823894110e6f161a29450dbdea44ab987cfe16bb 23-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Modified pseudoconstant test case to make it a bit clearer and fix a missing line

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
db34ab70961ca4b24b600eb47053d7af304659f5 23-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
245adabd97c8c770c13935a9075f2243cc6f1d57 18-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
50e8ac2369951d200e0d3849465d481f20fbdb62 16-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
a7a8a450d908b34fa5f569f2e694ebd4b61aae2f 13-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
1fafd1d96419f587763d1b81332d8f476aeace2e 07-Aug-2010 Tom Care <tcare@apple.com> Removed IdempotentOperationChecker from default analysis and returned back to a flag (-analyzer-check-idempotent-operations)
- Added IdempotentOperationChecker to experimental analyses for testing purposes
- Updated test cases to explictly call the checker

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
d85770b4ef71cf9168deb9a73f6a97d5cff1db29 30-Jul-2010 Tom Care <tcare@apple.com> Test case for PR7763.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
3e5637f8a1c5b3cc3fa9d4e33a5763883ea97fc6 27-Jul-2010 Ted Kremenek <kremenek@apple.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
453293109e670824d84e94c0c2891737e3261f1f 17-Jul-2010 Ted Kremenek <kremenek@apple.com> Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
df4ca423ec7d9b62842e112d1b824faa08b64810 16-Jul-2010 Tom Care <tcare@apple.com> 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
925198d693a0cf874452adcc2a8de1cb3d86992e 07-Jul-2010 Tom Care <tcare@apple.com> Fix idempotent operations test command line arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c
db2fa8a7eb67b1e8f32a590b8e000e1259cff91a 06-Jul-2010 Tom Care <tcare@apple.com> Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/idempotent-operations.c