Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Convert a few more uses of std::string& to llvm::StringRef. | Ted Kremenek | 2010-01-15 | 1 | -1/+1 | |
| | | | | llvm-svn: 93506 | |||||
* | Fix pr6035. | Zhongxing Xu | 2010-01-14 | 1 | -0/+3 | |
| | | | | llvm-svn: 93422 | |||||
* | Add an unreachable code checker. | Mike Stump | 2010-01-13 | 1 | -0/+4 | |
| | | | | llvm-svn: 93287 | |||||
* | Fix pasto. | Benjamin Kramer | 2010-01-11 | 1 | -1/+1 | |
| | | | | llvm-svn: 93181 | |||||
* | Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase). | Benjamin Kramer | 2010-01-11 | 1 | -12/+13 | |
| | | | | llvm-svn: 93175 | |||||
* | Roll out ASTContext::getTypeSizeInChars(), replacing instances of | Ken Dyck | 2010-01-11 | 3 | -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 Xu | 2010-01-11 | 1 | -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 Xu | 2010-01-11 | 1 | -0/+4 | |
| | | | | | | This with previous patch fixes a OSAtomic test case. llvm-svn: 93146 | |||||
* | Switch RegionStore over to using <BaseRegion+raw offset> to store | Ted Kremenek | 2010-01-11 | 4 | -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 Kremenek | 2010-01-11 | 1 | -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(). A | Ted Kremenek | 2010-01-09 | 1 | -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 Kremenek | 2010-01-09 | 1 | -3/+11 | |
| | | | | llvm-svn: 93071 | |||||
* | When binding an rvalue to a reference, create a temporary object. Use | Zhongxing Xu | 2010-01-09 | 3 | -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 statements | Ted Kremenek | 2010-01-08 | 1 | -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 Xu | 2010-01-05 | 1 | -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 Kremenek | 2010-01-05 | 4 | -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' from | Ted Kremenek | 2010-01-05 | 5 | -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 Xu | 2009-12-31 | 3 | -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 Xu | 2009-12-30 | 1 | -11/+2 | |
| | | | | llvm-svn: 92305 | |||||
* | Remove some dead variables clang-analyzer found. | Benjamin Kramer | 2009-12-25 | 1 | -2/+0 | |
| | | | | llvm-svn: 92162 | |||||
* | Fix typo spotted by MSVC. | Benjamin Kramer | 2009-12-25 | 1 | -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 Xu | 2009-12-24 | 2 | -17/+21 | |
| | | | | llvm-svn: 92121 | |||||
* | Enhance dataflow analyses to recognize branch statements in the CFG used as ↵ | Ted Kremenek | 2009-12-24 | 1 | -1/+13 | |
| | | | | | | hooks for the initialization of condition variables. llvm-svn: 92119 | |||||
* | Inter-procedural analysis: now we can return from the callee. | Zhongxing Xu | 2009-12-24 | 1 | -0/+37 | |
| | | | | llvm-svn: 92116 | |||||
* | Teach GRExprEngine to handle the initialization of the condition variable of ↵ | Ted Kremenek | 2009-12-24 | 1 | -0/+6 | |
| | | | | | | a ForStmt. llvm-svn: 92114 | |||||
* | Add CFG support for the initializer of the condition variable of a ForStmt. | Ted Kremenek | 2009-12-24 | 1 | -0/+13 | |
| | | | | llvm-svn: 92113 | |||||
* | CFG tweak: in a WhileStmt, the condition variable initializer is evaluated ↵ | Ted Kremenek | 2009-12-24 | 1 | -14/+13 | |
| | | | | | | every time the condition is checked. llvm-svn: 92111 | |||||
* | Teach GRExprEngine to handle the initialization of the condition variable of ↵ | Ted Kremenek | 2009-12-24 | 1 | -0/+6 | |
| | | | | | | a WhileStmt. llvm-svn: 92106 | |||||
* | Add CFG support for the initializer of the condition variable of a WhileStmt. | Ted Kremenek | 2009-12-24 | 1 | -1/+14 | |
| | | | | llvm-svn: 92105 | |||||
* | Teach GRExprEngine to handle the initialization of the condition variable of ↵ | Ted Kremenek | 2009-12-24 | 1 | -7/+11 | |
| | | | | | | a SwitchStmt. llvm-svn: 92102 | |||||
* | Add CFG support for the initializer of the condition variable of a SwitchStmt. | Ted Kremenek | 2009-12-24 | 1 | -2/+13 | |
| | | | | llvm-svn: 92101 | |||||
* | Tidy up FindSubExprAssignments to not deference the child_iterator multiple ↵ | Ted Kremenek | 2009-12-23 | 1 | -7/+10 | |
| | | | | | | times. llvm-svn: 92087 | |||||
* | move a few more symbols to .rodata/.data.rel.ro | Nuno Lopes | 2009-12-23 | 1 | -1/+1 | |
| | | | | llvm-svn: 92012 | |||||
* | Migrate the call inliner to the Checker interface. | Zhongxing Xu | 2009-12-23 | 1 | -29/+36 | |
| | | | | llvm-svn: 91991 | |||||
* | For inter-procedural analysis, predecessor node may be in another function. | Zhongxing Xu | 2009-12-23 | 1 | -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 Kremenek | 2009-12-23 | 2 | -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 Kremenek | 2009-12-23 | 1 | -0/+4 | |
| | | | | | | CXXExprTemporaries. llvm-svn: 91986 | |||||
* | Add stack trace pretty printing in GRExprEngine::VisitLValue(). | Ted Kremenek | 2009-12-23 | 1 | -0/+4 | |
| | | | | llvm-svn: 91985 | |||||
* | Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now). | Ted Kremenek | 2009-12-23 | 1 | -0/+1 | |
| | | | | llvm-svn: 91982 | |||||
* | Fix PR 5857. When casting from a symbolic region to an integer back to a ↵ | Ted Kremenek | 2009-12-23 | 1 | -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 Kremenek | 2009-12-23 | 1 | -1/+2 | |
| | | | | llvm-svn: 91970 | |||||
* | Also treat the type of the subexpression as a pointer in ↵ | Ted Kremenek | 2009-12-23 | 1 | -0/+1 | |
| | | | | | | GRExprEngine::VisitCast when the expression is handled as an lvalue. llvm-svn: 91969 | |||||
* | Add basic support for analyzing CastExprs as lvalues. | Ted Kremenek | 2009-12-23 | 1 | -3/+27 | |
| | | | | llvm-svn: 91952 | |||||
* | Add transfer functions support for visiting an Objective-C message ↵ | Ted Kremenek | 2009-12-22 | 2 | -42/+78 | |
| | | | | | | expression as an lvalue when the return type is a C++ reference. llvm-svn: 91926 | |||||
* | Add comments. | Zhongxing Xu | 2009-12-21 | 1 | -0/+1 | |
| | | | | llvm-svn: 91818 | |||||
* | Use the FunctionDecl's result type to know exactly if it returns a reference. | Zhongxing Xu | 2009-12-19 | 1 | -0/+10 | |
| | | | | llvm-svn: 91751 | |||||
* | Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. ↵ | Ted Kremenek | 2009-12-18 | 1 | -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 Kremenek | 2009-12-17 | 1 | -6/+4 | |
| | | | | llvm-svn: 91615 | |||||
* | Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion ↵ | Ted Kremenek | 2009-12-17 | 1 | -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 Kremenek | 2009-12-17 | 1 | -35/+46 | |
| | | | | llvm-svn: 91610 |