summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/SimpleSValuator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-428/+0
| | | | | | | | | | | | | | | | | | | | | | | | | (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
* Switch RegionStore over to using <BaseRegion+raw offset> to storeTed Kremenek2010-01-111-4/+4
| | | | | | | | | | | | | | value bindings. Along with a small change to OSAtomicChecker, this resolves <rdar://problem/7527292> and resolves some long-standing issues with how values can be bound to the same physical address by not have the same "key". This change is only a beginning; logically RegionStore needs to better handle loads from addresses where the stored value is larger/smaller/different type than the loaded value. We handle these cases in an approximate fashion now (via CastRetrievedVal and help in SimpleSValuator), but it could be made much smarter. llvm-svn: 93137
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-281-2/+1
| | | | llvm-svn: 90028
* Fix another static analyzer crash due to a corner case in "folding" symbolic ↵Ted Kremenek2009-10-171-11/+16
| | | | | | values that are constrained to be a constant. llvm-svn: 84320
* Fix static analyzer crash due to recently add symbolic-value constant ↵Ted Kremenek2009-10-161-1/+9
| | | | | | | | | folding. The issue was falsely converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the RHS. llvm-svn: 84269
* Fix crash introduced by r83358 where a symbol could be eagerlyTed Kremenek2009-10-061-2/+7
| | | | | | | evaluated to an APSInt with a different bitwidth than the other operand in a binary expression. llvm-svn: 83368
* Fix: <rdar://problem/7275774> Static analyzer warns about NULL pointer whenTed Kremenek2009-10-061-4/+22
| | | | | | | | | | | | | | | | | adding assert This fix required a few changes: SimpleSValuator: - Eagerly replace a symbolic value with its constant value in EvalBinOpNN when it is constrained to a constant. This allows us to better constant fold values along a path. - Handle trivial case of '<', '>' comparison of pointers when the two pointers are exactly the same. RegionStoreManager: llvm-svn: 83358
* Fix <rdar://problem/7249327> by allowing silent conversions between signed ↵Ted Kremenek2009-09-251-0/+9
| | | | | | and unsigned integer values for symbolic values. This is an intermediate solution (i.e. hack) until we support extension/truncation of symbolic integers. llvm-svn: 82737
* Introduce "DefinedOrUnknownSVal" into the SVal class hierarchy, providing a wayTed Kremenek2009-09-111-6/+0
| | | | | | | | | | | | to statically type various methods in SValuator/GRState as required either a defined value or a defined-but-possibly-unknown value. This leads to various logic cleanups in GRExprEngine, and lets the compiler enforce via type checking our assumptions about what symbolic values are possibly undefined and what are not. Along the way, clean up some of the static analyzer diagnostics regarding the uses of uninitialized values. llvm-svn: 81579
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-44/+44
| | | | llvm-svn: 81346
* Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCastTed Kremenek2009-07-211-2/+4
| | | | | | | | | to SValuator::EvalCast. In the process, the StoreManagers now use this new cast machinery, and the hack in GRExprEngine::EvalBind to handle implicit casts involving OSAtomicCompareAndSwap and friends has been removed (and replaced with logic closer to the logic specific to those functions). llvm-svn: 76641
* RegionStore:Ted Kremenek2009-07-211-2/+20
| | | | | | | | | | -refactor logic for retrieving bindings from VarDecls into RegionStoreManager::RetrieveVar() - improve RegionStoreManager::CastRetrievedVal() and SimpleSValuate::EvalCastNL to better handle casts of values of the same canonical type as well as casts of LocAsInteger values. llvm-svn: 76516
* Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.Ted Kremenek2009-07-201-3/+8
| | | | llvm-svn: 76481
* Move RegionStoreManager over to using newTed Kremenek2009-07-161-4/+4
| | | | | | | | ValueManager::makeArrayIndex()/convertArrayIndex() methods. This handles yet another crash case when reasoning about array indices of different bitwidth and signedness. llvm-svn: 75884
* Enhance SimpleSValuator::EvalBinOpNN to recognize the trivial caseTed Kremenek2009-07-131-1/+20
| | | | | | | | | | | | where we are comparing a symbolic value against itself, regardless of the nature of that symbolic value. This enhancement identified a case where RegionStoreManager is not correctly symbolicating the values of the pointees of parameters. The failing test is now in 'test/Analysis/misc-ps-region-store.m', with that test file now (temporarily) marked XFAIL. llvm-svn: 75521
* Unbreak build.Ted Kremenek2009-06-261-0/+346
llvm-svn: 74238
OpenPOWER on IntegriCloud