summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove GRStateManager::BindLoc() and GRStateManager::Unbind().Ted Kremenek2009-06-231-1/+1
| | | | llvm-svn: 73996
* Remove GRStateManager::BindDecl() and GRStateManager::BindDeclWithInit().Ted Kremenek2009-06-231-2/+2
| | | | llvm-svn: 73995
* Move 'hasStackStorage()' and 'hasHeapStorage()' from MemRegionManager to ↵Ted Kremenek2009-06-231-1/+1
| | | | | | MemRegion. llvm-svn: 73973
* Move all factory methods from SVal to ValueManager. API cleanup!Zhongxing Xu2009-06-231-17/+20
| | | | llvm-svn: 73954
* ValueManager::makeNonLoc -> ValueManager::makeIntValZhongxing Xu2009-06-231-2/+1
| | | | | | Clean up code with ValueManager. llvm-svn: 73951
* Remove more GetSVal/GetLValue methods in GRExprEngine/GRState, insteadTed Kremenek2009-06-191-110/+106
| | | | | | | preferring to use their replacements in GRState. This further unifies the code paths for such logic and leads to some code reduction. llvm-svn: 73771
* Move clients over from using GRStateManager::BindXXX and friends toTed Kremenek2009-06-181-5/+3
| | | | | | GRState->bindXXX and friends (and constify some arguments along the way). llvm-svn: 73740
* libAnalysis:Ted Kremenek2009-06-181-124/+70
| | | | | | | | | - Remove the 'isFeasible' flag from all uses of 'Assume'. - Remove the 'Assume' methods from GRStateManager. Now the only way to create a new GRState with an assumption is to use the new 'assume' methods in GRState. llvm-svn: 73731
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-1/+2
| | | | llvm-svn: 73702
* Remove more dependencies on GRStateRef. As a consequence, we can nowTed Kremenek2009-06-181-10/+9
| | | | | | | pretty-print a GRState object anywhere it is referenced (instead of needing a GRStateRef of a GRStateManager handy). llvm-svn: 73669
* Sink the BuiltinInfo object from ASTContext into theChris Lattner2009-06-141-0/+1
| | | | | | | | preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
* * API change: we need to pass GRState to GRExprEngine::EvalBinOp() becauseZhongxing Xu2009-05-201-14/+16
| | | | | | | | RegionStore needs to know the type of alloca region. * RegionStoreManager::EvalBinOp() now converts the alloca region to its first element region, as what is done to symbolic region. llvm-svn: 72164
* As discussed with Ted, rename TypedRegion::getObjectType() to Zhongxing Xu2009-05-091-1/+1
| | | | | | TypedRegion::getValueType(). llvm-svn: 71321
* rename: MemRegion:Zhongxing Xu2009-05-091-1/+1
| | | | | | | | | RValueType => ObjectType LValueType => LocationType No functionality change. llvm-svn: 71304
* analyzer: Add ProgramPoint 'PostLValue' just to distinguish (forTed Kremenek2009-05-071-5/+21
| | | | | | | analysis introspection) when we computed an lvalue. This shouldn't effect the current analysis results in any way. llvm-svn: 71169
* Per conversations with Zhongxing, add an 'element type' toTed Kremenek2009-05-041-1/+2
| | | | | | | | | | | | | | | | | | | ElementRegion. I also removed 'ElementRegion::getArrayRegion', although we may need to add this back. This breaks a few test cases with RegionStore: - 'array-struct.c' triggers an infinite recursion in RegionStoreManager. Need to investigate. - misc-ps.m triggers a failure with RegionStoreManager as we now get the diagnostic: 'Line 159: Uninitialized or undefined return value returned to caller.' There were a bunch of places that needed to be edit RegionStoreManager, and we may not be passing all the correct 'element types' down from GRExprEngine. Zhongxing: When you get a chance, could you review this? I could have easily screwed up something basic in RegionStoreManager. llvm-svn: 70830
* split ObjC and C++ Statements out into their own headers.Chris Lattner2009-04-261-1/+3
| | | | llvm-svn: 70105
* Fix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolicTed Kremenek2009-04-231-2/+1
| | | | | | target addresses. llvm-svn: 69900
* Fix crash reported in PR 3991. The analyzer doesn't reason about ObjCKVCExpr.Ted Kremenek2009-04-211-0/+1
| | | | llvm-svn: 69754
* Fix: <rdar://problem/6777209> false Dereference of null pointer in loop: ↵Ted Kremenek2009-04-211-1/+25
| | | | | | | | | | pointer increment/decrement preserves non-nullness When the StoreManager doesn't reason well about pointer-arithmetic, propagate the non-nullness constraint on a pointer value when performing pointer arithmetic uisng ++/--. llvm-svn: 69741
* get a CodeTextRegion when visiting FunctionDecl reference.Zhongxing Xu2009-04-201-13/+8
| | | | | | get FunctionDecl with more general utility method. llvm-svn: 69570
* Add analyzer support for objc_atomicCompareAndSwap()Ted Kremenek2009-04-111-2/+3
| | | | llvm-svn: 68849
* Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"Ted Kremenek2009-04-111-11/+172
| | | | | | | | | ProgramPoints all the way through to GRCoreEngine. NSString.m now fails with RegionStoreManager because of the void** cast. Disabling use of region store for that test for now. llvm-svn: 68845
* Finally nuke loc::SymbolVal.Zhongxing Xu2009-04-101-37/+1
| | | | llvm-svn: 68771
* Fix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized ↵Ted Kremenek2009-04-101-1/+25
| | | | | | | | value (argc is guaranteed to be >= 1) The analyzer now adds the precondition that the first argument of 'main' is > 0. llvm-svn: 68757
* Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allowsTed Kremenek2009-04-101-1/+1
| | | | | | | clients of the analyzer to designate custom assertion routines as "noreturn" functions from the analyzer's perspective but not the compiler's. llvm-svn: 68746
* - Move ownership of MemRegionManager into ValueManager.Ted Kremenek2009-04-091-11/+6
| | | | | | | - Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. llvm-svn: 68731
* Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.Ted Kremenek2009-04-091-1/+2
| | | | llvm-svn: 68711
* clean up code with new API.Zhongxing Xu2009-04-091-4/+2
| | | | llvm-svn: 68700
* clean up code with new API.Zhongxing Xu2009-04-091-4/+2
| | | | llvm-svn: 68699
* clean up code with new API.Zhongxing Xu2009-04-091-8/+2
| | | | llvm-svn: 68698
* stop using loc::SymbolVal.Zhongxing Xu2009-04-091-2/+3
| | | | llvm-svn: 68697
* Fix a null pointer dereference error due to state caching in a loop involvingTed Kremenek2009-04-091-7/+6
| | | | | | sending a message to a nil receiver. llvm-svn: 68686
* Create a symbolic region instead of a loc::SymbolVal. This is a continued stepZhongxing Xu2009-04-091-1/+2
| | | | | | to eliminate the use of loc::SymbolVal. llvm-svn: 68685
* GRExprEngine: Don't try to reason about the size of 'void' for the return typeTed Kremenek2009-04-091-33/+38
| | | | | | of messages sent to nil. llvm-svn: 68683
* Fix another regression introduced by changes to the analyzer's reasoning aboutTed Kremenek2009-04-091-11/+12
| | | | | | nil receivers in message expressions. llvm-svn: 68672
* Refactor/cleanup reasoning of nil receivers in message expressions.Ted Kremenek2009-04-091-28/+38
| | | | llvm-svn: 68661
* Enhance analyzer reasoning about sending messages to nil. A nil receiver ↵Ted Kremenek2009-04-081-2/+15
| | | | | | returns 0 for scalars of size <= sizeof(void*). llvm-svn: 68629
* New static analyzer check by Nikita Zhuk!Ted Kremenek2009-04-081-14/+34
| | | | | | | | | "The attached patch generates warnings of cases where an ObjC message is sent to a nil object and the size of return type of that message is larger than the size of void pointer. This may result in undefined return values as described in PR 2718. The patch also includes test cases." llvm-svn: 68585
* This is the first step to gradually remove the use of loc::SymbolVal. NowZhongxing Xu2009-04-031-2/+17
| | | | | | | | when creating symbolic values, we distinguish between location and non-location values. For location values, we create a symbolic region instead of a loc::SymbolVal. llvm-svn: 68373
* Fix: <rdar://problem/6740387>. Sending nil to an object that returns a structTed Kremenek2009-04-011-2/+3
| | | | | | | should only be an error if that value is consumed. This fix was largely accomplished by moving 'isConsumedExpr' back to ParentMap. llvm-svn: 68195
* Add version of GRExprEngine::AddCheck that registered a GRSimpleAPICheck thatTed Kremenek2009-03-301-10/+26
| | | | | | will be called for every expression in a basic block. llvm-svn: 68041
* Implement a FIXME.Zhongxing Xu2009-03-301-1/+1
| | | | llvm-svn: 68024
* rename some methods.Chris Lattner2009-03-281-1/+1
| | | | llvm-svn: 67923
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-281-7/+9
| | | | | | | | | | | | | | | | | LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-16/+18
| | | | | | | | | | | | | | | | Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. llvm-svn: 67731
* GRExprEngine:Ted Kremenek2009-03-201-1/+7
| | | | | | | | - Conjure symbols at '--' and '++' unary operations - Add utility method SVal::GetConjuredSymbolVal() and constify some arguments along the way. llvm-svn: 67395
* Fix PR 3836 by eagerly assuming symbolic constraints returned by unary '!'.Ted Kremenek2009-03-181-2/+10
| | | | llvm-svn: 67260
* Add a hack in the analyzer to recover some path-sensitivity at branchTed Kremenek2009-03-131-1/+58
| | | | | | | | | | | | | | | | | | conditions. Currently the analyzer does not reason well about promotions/truncations of symbolic values, so at branch conditions when we see: if (condition) and condition is something like a 'short' or 'char', essentially ignore the promotion to 'int' so that we track constraints on the original symbolic value. We only ignore the casts if the underlying type has the same or fewer bits as the converted type. This fixes: <rdar://problem/6619921> llvm-svn: 66899
* GRExprEngine::ProcessBranch: Don't register a "pretty-stack printer" when ↵Ted Kremenek2009-03-111-7/+6
| | | | | | the Condition is null. llvm-svn: 66636
OpenPOWER on IntegriCloud