summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/SimpleSValuator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a new symbol type, SymbolExtent, to represent the extents of memory ↵Jordy Rose2010-07-041-0/+22
| | | | | | | | | | regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals. Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited. The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking. llvm-svn: 107577
* Pointers casted as integers still count as locations to SimpleSValuator, so ↵Jordy Rose2010-06-301-1/+6
| | | | | | don't crash if we do a funny thing like ((int)ptr)&1. Fixes PR7527. llvm-svn: 107236
* Pointer comparisons (and pointer-pointer subtraction). Basically filling in ↵Jordy Rose2010-06-281-54/+305
| | | | | | SimpleSValuator::EvalBinOpLL(). llvm-svn: 106992
* When folding additive operations, convert the values to the same type. When ↵Jordy Rose2010-06-211-6/+13
| | | | | | assuming relationships, convert the integers to the same type as the symbol, at least for now. llvm-svn: 106458
* Add braces to avoid an ambiguous else, fixing a GCC warning.Benjamin Kramer2010-06-201-3/+3
| | | | llvm-svn: 106403
* Adds analyzer support for idempotent and tautological binary operations such ↵Jordy Rose2010-06-201-9/+108
| | | | | | as "a*0" and "a+0". This is not very powerful, but does make the analyzer look a little smarter than it actually is. llvm-svn: 106402
* Fold additive constants, and support comparsions of the form $sym+const1 <> ↵Jordy Rose2010-06-181-50/+75
| | | | | | const2 llvm-svn: 106339
* Static analyzer: Don't crash when casting a symbolic region address to a ↵Ted Kremenek2010-04-161-8/+14
| | | | | | float. Fixes PR 6854. llvm-svn: 101499
* Remove unused parameter.Zhongxing Xu2010-02-051-1/+1
| | | | llvm-svn: 95364
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-0/+428
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
OpenPOWER on IntegriCloud