Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 4b2d0dde88 Eliminate dependency on where test is run from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 22:47:27 +00:00
Ben Laurie 61a3778c81 Don't include alloca.h if it doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 17:33:31 +00:00
Ted Kremenek be1fe1eb12 Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp.
- Unified specification of stores/constraints/output to be:
   -analyzer-output=...
   -analyzer-store=...
   -analyzer-constraints=...
  instead of -analyzer-range-constraints, -analyzer-store-basic, etc.
- Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new
  interface
- Updated test cases to conform to new driver options


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 04:27:41 +00:00
Ted Kremenek b78284a0ee This test case now passes with RegionStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 22:49:49 +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
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
Ted Kremenek cfec1db63f Temporarily XFAIL these tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 19:27:01 +00:00
Anders Carlsson 31483b48c7 include alloca.h instead of malloc.h. If this doesn't work for everyone we can just declare alloca directly in the file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58853 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 15:41:33 +00:00
Argyrios Kyrtzidis ff6ec39036 Bring in 'alloca' for the Analysis/stack-addr-ps.c test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 14:00:25 +00:00
Ted Kremenek c979a9b066 Add 'alloca' test case for return-of-stack-address checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 00:37:31 +00:00
Ted Kremenek beb62c5836 Added missing 'expected-warning'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58481 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 00:20:13 +00:00
Ted Kremenek fab6f220cd Enhance compound literal test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 00:19:42 +00:00
Ted Kremenek 64cc62d502 Add missing "expected warning".
Add compound literal with empty initializer (just to test the analyzer handles it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 23:17:05 +00:00
Ted Kremenek d4a07988c8 Improve compound literal test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 18:46:50 +00:00
Ted Kremenek c532f633a9 Add 'expected-warning' for braces around scalar initializer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 22:00:16 +00:00
Ted Kremenek 194aade5a0 Added compound literal test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 21:57:17 +00:00
Ted Kremenek 22bda887aa Enhanced path-sensitive return-of-stack-address check to print out the name of the variable whose address was returned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 20:31:27 +00:00
Ted Kremenek d71ed26dd8 Refactored all logic to run the GRSimpleVals and CFRef checker into a common
code path in the clang driver.

Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:16:52 +00:00
Ted Kremenek 02737ed29d Added path-sensitive check for return statements that return the address
of a stack variable.  This is the path-sensitive version of a check that
is already done during semantic analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 15:02:58 +00:00