Commit Graph

74 Commits

Author SHA1 Message Date
Zhongxing Xu 562c4d9041 Implement retrieval of the default value of element and field regions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 11:22:12 +00:00
Zhongxing Xu b61f49cb3c Add a test case for init expr of array and struct type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 10:23:13 +00:00
Ted Kremenek a7ac9444b4 Fix RegionStore::getLValueElement() to handle the case when the base region is not an ElementRegion (also do some cleanups of its core logic).
This gets array-struct.c to work with RegionStore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 20:27:48 +00:00
Daniel Dunbar d427023c33 Add -analyze action to run static analyzer, instead of inferring from
individual checker options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 23:17:32 +00:00
Zhongxing Xu 5834ed6999 Add KillStruct to region store.
- put the killed region in the kill set.
 - set its default value to unknown.
 - removes all bindings for its subregions.  


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 01:49:57 +00:00
Ted Kremenek 6eddeb1534 MemRegion:
- Overhauled the notion of "types" for TypedRegions.  We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()).  Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs.
- Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type.  We can add it back once there is a need for it and we can resolve its role with these concepts.

StoreManager:
- Overhauled StoreManager::CastRegion.  It expects an *lvalue* type for a region.  This is actually what motivated the overhaul to the MemRegion type mechanism.  It also no longer returns an SVal; we can just return a MemRegion*.
- BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts.  This matches with the MemRegion changes.
- Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion().

AuditCFNumberCreate check:
- Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type.  This change was needed to work with the changes to StoreManager::CastRegion.

GRExprEngine::VisitCast:
- Conform to the new interface of StoreManager::CastRegion.

Tests:
- None of the analysis tests fail now for using the "basic store".
- Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 21:49:13 +00:00
Zhongxing Xu 34a83474c8 remove a test case that causes compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 05:59:27 +00:00
Zhongxing Xu 27cae9e327 Add test for initializing array with string literal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60281 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 05:51:19 +00:00
Zhongxing Xu 661fc39abc Add documentation for test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 01:45:11 +00:00
Zhongxing Xu 33d7cbfc0a Add no-warning to test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 23:45:56 +00:00
Zhongxing Xu ea06544bea Improve test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 05:50:21 +00:00
Zhongxing Xu 617ff31664 Add test cast for struct array.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 13:30:46 +00:00
Zhongxing Xu 512cdb57a0 Re-enable array-struct test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:47:39 +00:00
Ted Kremenek 82bd99f4db - Revert r59229 and r59232: AllocRegion should be immutable.
- Temporarily disabled test Analysis/array-struct.c for region store.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59245 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 15:42:31 +00:00
Zhongxing Xu 26134a1b59 Add test for unsigned array index.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 09:20:05 +00:00
Zhongxing Xu fb75b2583e Add test for incomplete struct pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 08:44:52 +00:00
Zhongxing Xu b670133b9e Add a test case for alloca().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:59:15 +00:00
Argyrios Kyrtzidis 7b2d21e371 Append the test runs with '&&'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 14:28:18 +00:00
Zhongxing Xu 04b90bc00f Add function side-effect test cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 13:17:44 +00:00
Zhongxing Xu df2aa1efbb Add test code for array initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 10:23:14 +00:00
Zhongxing Xu 234a7d2bf5 Add test for SCA region store.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 09:19:25 +00:00
Zhongxing Xu 2e971208f4 Add StringLiteral test code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 14:11:23 +00:00
Zhongxing Xu 72e1682bbd Add random array and struct test code for SCA.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 08:51:58 +00:00
Zhongxing Xu ef8b28e945 Add test case for array and struct variable lvalue evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57670 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 05:19:52 +00:00