summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix idempotent operations false positive caused by ivars not being ↵Ted Kremenek2010-08-021-2/+11
| | | | | | | | invalidated in function calls when the enclosing object had retain/release state. Fixes <rdar://problem/8261992>. llvm-svn: 110068
* Further adjustments to -Wglobal-constructors; works for references and directJohn McCall2010-08-021-1/+1
| | | | | | initializations now. llvm-svn: 110063
* 'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; ↵Ted Kremenek2010-08-021-8/+5
| | | | | | | | no need to two lookups in the hashtable. llvm-svn: 110059
* Improve flat store: MemRegion::getAsOffset() computes a region's offset withinZhongxing Xu2010-08-025-17/+88
| | | | | | | | the top-level object. FlatStore now can bind and retrieve element and field regions. PR7297 is fixed by flat store. llvm-svn: 110020
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-17/+156
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Uncomment unfinished work bailout in IdempotentOperationsChecker.Tom Care2010-07-301-2/+2
| | | | llvm-svn: 109893
* Use a LazyCompoundVal to handle initialization with a string literal, rather ↵Jordy Rose2010-07-291-35/+12
| | | | | | than copying each character. llvm-svn: 109734
* Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, ↵Ted Kremenek2010-07-291-0/+3
| | | | | | and CharacterLiteral. Fixes an assertion failure reported in PR 7675. llvm-svn: 109719
* Augment RegionStore::BindStruct() to bind symbolicated struct values. This ↵Ted Kremenek2010-07-291-6/+8
| | | | | | fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires. llvm-svn: 109710
* Change SymbolManager::canSymbolicate() to return true for RecordTypes.Ted Kremenek2010-07-291-1/+10
| | | | llvm-svn: 109709
* Explicitly guard in BasicStore from storing to non-scalars.Ted Kremenek2010-07-291-5/+3
| | | | llvm-svn: 109708
* Remove extraneous guards around the call to getConjuredSymbolVal(). These ↵Ted Kremenek2010-07-291-6/+4
| | | | | | checks are already done within getConjuredSymbolVal() itself. llvm-svn: 109707
* Added some false positive checking to UnreachableCodeCheckerTom Care2010-07-271-31/+92
| | | | | | | | | - Allowed reporting of dead macros - Added path walking function to search for false positives in conditional statements - Updated some affected tests - Added some false positive test cases llvm-svn: 109561
* Extracted out some useful common functions in IdempotentOperationChecker to ↵Tom Care2010-07-273-86/+86
| | | | | | their own CheckerHelpers file. llvm-svn: 109560
* Finesse 'idempotent operations' analyzer issues to include the opcode of the ↵Ted Kremenek2010-07-271-10/+16
| | | | | | binary operator for clearer error reporting. Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same. llvm-svn: 109527
* Put 'Idempotent operations' static analyzer issues in the 'Dead code' category.Ted Kremenek2010-07-271-1/+2
| | | | llvm-svn: 109517
* Don't warn about unreachable code if the block starts with ↵Jordy Rose2010-07-271-1/+16
| | | | | | | | __builtin_unreachable(). The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810. llvm-svn: 109487
* Groundwork for C string length tracking. Currently only handles the length ↵Jordy Rose2010-07-271-2/+189
| | | | | | of constant string literals, which is not too helpful, and only calls to strlen() are checked. llvm-svn: 109480
* Added an path-sensitive unreachable code checker to the experimental ↵Tom Care2010-07-234-9/+154
| | | | | | | | | | analyzer checks. - Created a new class to do post-analysis - Updated several test cases with unreachable code to expect a warning - Added some general tests llvm-svn: 109286
* Add FILE* leak check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-231-3/+78
| | | | llvm-svn: 109225
* Change arg type.Zhongxing Xu2010-07-231-1/+1
| | | | llvm-svn: 109218
* Delete unnecessary const_cast.Zhongxing Xu2010-07-231-1/+1
| | | | llvm-svn: 109211
* AnalysisContext is not const.Zhongxing Xu2010-07-231-1/+1
| | | | llvm-svn: 109210
* This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-221-7/+25
| | | | llvm-svn: 109106
* Make a bunch of new data structures for the new analysisZhongxing Xu2010-07-222-4/+84
| | | | | | | engine of the new translation unit. State marshal is there but no real work is done. End nodes are passed back. llvm-svn: 109105
* Move some methods inline.Zhongxing Xu2010-07-211-34/+0
| | | | llvm-svn: 108988
* Constify all references to Stmt* and CFGBlock* in libChecker.Zhongxing Xu2010-07-207-174/+182
| | | | llvm-svn: 108811
* Constify.Zhongxing Xu2010-07-201-12/+15
| | | | llvm-svn: 108804
* remove const_cast.Zhongxing Xu2010-07-201-2/+1
| | | | llvm-svn: 108803
* constify.Zhongxing Xu2010-07-201-2/+2
| | | | llvm-svn: 108801
* Constify.Zhongxing Xu2010-07-203-11/+12
| | | | llvm-svn: 108800
* remove CallInliner.cpp.Zhongxing Xu2010-07-191-0/+0
| | | | llvm-svn: 108670
* Add double close check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-191-4/+87
| | | | llvm-svn: 108669
* Reapply r108617.Zhongxing Xu2010-07-197-73/+70
| | | | llvm-svn: 108668
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-181-1/+0
| | | | llvm-svn: 108633
* Revert r108617, it broke the build.Benjamin Kramer2010-07-176-39/+73
| | | | llvm-svn: 108621
* Prepare the analyzer for the callee in another translation unit:Zhongxing Xu2010-07-176-73/+39
| | | | | | | Let AnalysisContext contain a TranslationUnit. Let CallEnter refer to an AnalysisContext instead of a FunctionDecl. llvm-svn: 108617
* Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by ↵Ted Kremenek2010-07-171-2/+1
| | | | | | removing a bogus assertion. llvm-svn: 108602
* Fix APFloat assertion failure in IdempotentOperationChecker resulting in havingTed Kremenek2010-07-171-4/+6
| | | | | | an APFloat with different "float semantics" than the compared float literal. llvm-svn: 108590
* Improved false positive rate for the idempotent operations checker and moved ↵Tom Care2010-07-165-7/+82
| | | | | | | | | | it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings llvm-svn: 108550
* Pass StringRefs by value.Benjamin Kramer2010-07-141-1/+1
| | | | llvm-svn: 108375
* Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor2010-07-131-0/+1
| | | | | | | | | | | | | | | | reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g., int i; reinterpret_cast<short&>(i); The IR generated for this is essentially the same as for *reinterpret_cast<short*>(&i). Fixes PR6437, PR7593, and PR7344. llvm-svn: 108294
* Cleanup in CStringChecker. Now properly bifurcates the state for ↵Jordy Rose2010-07-081-139/+171
| | | | | | zero/nonzero sizes. llvm-svn: 107935
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-2/+2
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-071-2/+2
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-2/+2
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Simplify code and remove comment that is no longer relevant.Argyrios Kyrtzidis2010-07-071-9/+2
| | | | llvm-svn: 107772
* Remove Decl::getCompoundBody().Argyrios Kyrtzidis2010-07-071-1/+1
| | | | | | | | This has 2 (slight) advantages: -Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt. -Better tracking of Decl::getBody()'s callsites. llvm-svn: 107771
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-074-10/+10
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Add memcmp() and bcmp() to CStringChecker. These check for valid access to ↵Jordy Rose2010-07-071-0/+66
| | | | | | the buffer arguments and have a special-case for when the buffer arguments are known to be the same address, or when the size is zero. llvm-svn: 107761
OpenPOWER on IntegriCloud