summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert a few more uses of std::string& to llvm::StringRef.Ted Kremenek2010-01-151-1/+1
| | | | llvm-svn: 93506
* Fix pr6035.Zhongxing Xu2010-01-141-0/+3
| | | | llvm-svn: 93422
* Add an unreachable code checker.Mike Stump2010-01-131-0/+4
| | | | llvm-svn: 93287
* Fix pasto.Benjamin Kramer2010-01-111-1/+1
| | | | llvm-svn: 93181
* Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).Benjamin Kramer2010-01-111-12/+13
| | | | llvm-svn: 93175
* Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck2010-01-113-12/+16
| | | | | | | | | | "ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. llvm-svn: 93153
* Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.Zhongxing Xu2010-01-111-0/+3
| | | | | | The old test case has a little mistake. llvm-svn: 93148
* Enhance SVals::getAsRegion: get the region that is converted to an integer.Zhongxing Xu2010-01-111-0/+4
| | | | | | This with previous patch fixes a OSAtomic test case. llvm-svn: 93146
* Switch RegionStore over to using <BaseRegion+raw offset> to storeTed Kremenek2010-01-114-52/+92
| | | | | | | | | | | | | | 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
* Preliminary reworking of value-binding logic in RegionStore:Ted Kremenek2010-01-111-31/+110
| | | | | | | | | | | | | (1) Introduce a new 'BindingKey' class to match 'BindingValue'. This gives us the flexibility to change the current key value from 'const MemRegion*' to something more interesting. (2) Rework additions/removals/lookups from the store to use new 'Remove', 'Add', 'Lookup' utility methods. No "real" functionality change; just prep work and abstraction. llvm-svn: 93136
* Fix overzealous assertion in GRExprEngine::VisitLValue(). ATed Kremenek2010-01-091-7/+25
| | | | | | | | | CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it returns a struct temporary. Currently the analyzer doesn't reason about struct temporary returned by function calls, but we shouldn't crash here either. llvm-svn: 93081
* Fix broken diagnostic when returning the address of a stack-allocated array.Ted Kremenek2010-01-091-3/+11
| | | | llvm-svn: 93071
* When binding an rvalue to a reference, create a temporary object. Use Zhongxing Xu2010-01-093-6/+39
| | | | | | | | CXXObjectRegion to represent it. In Environment, lookup a literal expression before make up a value for it. llvm-svn: 93047
* Fix handling in GRExprEngine of 'default' branch in switch statementsTed Kremenek2010-01-081-5/+12
| | | | | | | | | when the default case is winnowed down to be infeasible. When all cases were ruled out (and the analysis state for the default case would be infeasible) we would still consider the default case possible. This fixes PR 5969. llvm-svn: 93017
* Revert r92318. Instead fix the analyzer: do not call Zhongxing Xu2010-01-051-2/+3
| | | | | | ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType. llvm-svn: 92723
* Make static analysis support for C++ 'this' expression context-sensitive. ↵Ted Kremenek2010-01-054-30/+46
| | | | | | Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it. llvm-svn: 92675
* Remove references to 'Checker' and 'GRTransferFuncs' fromTed Kremenek2010-01-055-59/+48
| | | | | | | | | | | | GRStateManager. Having these references was an abstraction violation, as they really should only be known about GRExprEngine. This change required adding a new 'ProcessAssume' callback in GRSubEngine. GRExprEngine implements this callback by calling 'EvalAssume' on all registered Checker objects as well as the registered GRTransferFunc object. llvm-svn: 92549
* Let constraint manager inform checkers that some assumption logic has happend.Zhongxing Xu2009-12-313-9/+54
| | | | | | | | | Add new states for symbolic regions tracked by malloc checker. This enables us to do malloc checking more accurately. See test case. Based on Lei Zhang's patch and discussion. llvm-svn: 92342
* Simplify code by using an equivalent template class.Zhongxing Xu2009-12-301-11/+2
| | | | llvm-svn: 92305
* Remove some dead variables clang-analyzer found.Benjamin Kramer2009-12-251-2/+0
| | | | llvm-svn: 92162
* Fix typo spotted by MSVC.Benjamin Kramer2009-12-251-2/+2
| | | | | | GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool' llvm-svn: 92154
* As Ted suggested, record the callsite information with the StackFrameContext.Zhongxing Xu2009-12-242-17/+21
| | | | llvm-svn: 92121
* Enhance dataflow analyses to recognize branch statements in the CFG used as ↵Ted Kremenek2009-12-241-1/+13
| | | | | | hooks for the initialization of condition variables. llvm-svn: 92119
* Inter-procedural analysis: now we can return from the callee.Zhongxing Xu2009-12-241-0/+37
| | | | llvm-svn: 92116
* Teach GRExprEngine to handle the initialization of the condition variable of ↵Ted Kremenek2009-12-241-0/+6
| | | | | | a ForStmt. llvm-svn: 92114
* Add CFG support for the initializer of the condition variable of a ForStmt.Ted Kremenek2009-12-241-0/+13
| | | | llvm-svn: 92113
* CFG tweak: in a WhileStmt, the condition variable initializer is evaluated ↵Ted Kremenek2009-12-241-14/+13
| | | | | | every time the condition is checked. llvm-svn: 92111
* Teach GRExprEngine to handle the initialization of the condition variable of ↵Ted Kremenek2009-12-241-0/+6
| | | | | | a WhileStmt. llvm-svn: 92106
* Add CFG support for the initializer of the condition variable of a WhileStmt.Ted Kremenek2009-12-241-1/+14
| | | | llvm-svn: 92105
* Teach GRExprEngine to handle the initialization of the condition variable of ↵Ted Kremenek2009-12-241-7/+11
| | | | | | a SwitchStmt. llvm-svn: 92102
* Add CFG support for the initializer of the condition variable of a SwitchStmt.Ted Kremenek2009-12-241-2/+13
| | | | llvm-svn: 92101
* Tidy up FindSubExprAssignments to not deference the child_iterator multiple ↵Ted Kremenek2009-12-231-7/+10
| | | | | | times. llvm-svn: 92087
* move a few more symbols to .rodata/.data.rel.roNuno Lopes2009-12-231-1/+1
| | | | llvm-svn: 92012
* Migrate the call inliner to the Checker interface.Zhongxing Xu2009-12-231-29/+36
| | | | llvm-svn: 91991
* For inter-procedural analysis, predecessor node may be in another function.Zhongxing Xu2009-12-231-3/+3
| | | | | | So we should use the current program point. llvm-svn: 91989
* Add CFG support for the condition variable that can appear in IfStmts in C++ ↵Ted Kremenek2009-12-232-1/+50
| | | | | | | | mode. Add transfer function support in GRExprEngine for IfStmts with initialized condition variables. llvm-svn: 91987
* Suppress dead store warnings involving objects initialized with ↵Ted Kremenek2009-12-231-0/+4
| | | | | | CXXExprTemporaries. llvm-svn: 91986
* Add stack trace pretty printing in GRExprEngine::VisitLValue().Ted Kremenek2009-12-231-0/+4
| | | | llvm-svn: 91985
* Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).Ted Kremenek2009-12-231-0/+1
| | | | llvm-svn: 91982
* Fix PR 5857. When casting from a symbolic region to an integer back to a ↵Ted Kremenek2009-12-231-8/+9
| | | | | | pointer value, we were not correctly layering the correct ElementRegion on the original SymbolicRegion. llvm-svn: 91981
* Teach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.Ted Kremenek2009-12-231-1/+2
| | | | llvm-svn: 91970
* Also treat the type of the subexpression as a pointer in ↵Ted Kremenek2009-12-231-0/+1
| | | | | | GRExprEngine::VisitCast when the expression is handled as an lvalue. llvm-svn: 91969
* Add basic support for analyzing CastExprs as lvalues.Ted Kremenek2009-12-231-3/+27
| | | | llvm-svn: 91952
* Add transfer functions support for visiting an Objective-C message ↵Ted Kremenek2009-12-222-42/+78
| | | | | | expression as an lvalue when the return type is a C++ reference. llvm-svn: 91926
* Add comments.Zhongxing Xu2009-12-211-0/+1
| | | | llvm-svn: 91818
* Use the FunctionDecl's result type to know exactly if it returns a reference.Zhongxing Xu2009-12-191-0/+10
| | | | llvm-svn: 91751
* Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. ↵Ted Kremenek2009-12-181-5/+52
| | | | | | Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer. llvm-svn: 91710
* Tweak formatting and comments.Ted Kremenek2009-12-171-6/+4
| | | | llvm-svn: 91615
* Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion ↵Ted Kremenek2009-12-171-45/+64
| | | | | | to evaluate the arguments of a CallExpr. This simplifies the logic and makes it easier to read. (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments) llvm-svn: 91613
* Reduce nesting by using early exits. No functionality change.Ted Kremenek2009-12-171-35/+46
| | | | llvm-svn: 91610
OpenPOWER on IntegriCloud