aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
AgeCommit message (Collapse)Author
2010-08-02Fix idempotent operations false positive caused by ivars not being ↵Ted Kremenek
invalidated in function calls when the enclosing object had retain/release state. Fixes <rdar://problem/8261992>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Further adjustments to -Wglobal-constructors; works for references and directJohn McCall
initializations now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; ↵Ted Kremenek
no need to two lookups in the hashtable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Improve flat store: MemRegion::getAsOffset() computes a region's offset withinZhongxing Xu
the top-level object. FlatStore now can bind and retrieve element and field regions. PR7297 is fixed by flat store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek
for malloc/free checking. Patch by Andrew McGregor! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30Uncomment unfinished work bailout in IdempotentOperationsChecker.Tom Care
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Use a LazyCompoundVal to handle initialization with a string literal, rather ↵Jordy Rose
than copying each character. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, ↵Ted Kremenek
and CharacterLiteral. Fixes an assertion failure reported in PR 7675. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Augment RegionStore::BindStruct() to bind symbolicated struct values. This ↵Ted Kremenek
fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Change SymbolManager::canSymbolicate() to return true for RecordTypes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Explicitly guard in BasicStore from storing to non-scalars.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Remove extraneous guards around the call to getConjuredSymbolVal(). These ↵Ted Kremenek
checks are already done within getConjuredSymbolVal() itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Added some false positive checking to UnreachableCodeCheckerTom Care
- 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Extracted out some useful common functions in IdempotentOperationChecker to ↵Tom Care
their own CheckerHelpers file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Finesse 'idempotent operations' analyzer issues to include the opcode of the ↵Ted Kremenek
binary operator for clearer error reporting. Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Put 'Idempotent operations' static analyzer issues in the 'Dead code' category.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Don't warn about unreachable code if the block starts with ↵Jordy Rose
__builtin_unreachable(). The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Groundwork for C string length tracking. Currently only handles the length ↵Jordy Rose
of constant string literals, which is not too helpful, and only calls to strlen() are checked. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Added an path-sensitive unreachable code checker to the experimental ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Add FILE* leak check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Change arg type.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Delete unnecessary const_cast.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23AnalysisContext is not const.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22Make a bunch of new data structures for the new analysisZhongxing Xu
engine of the new translation unit. State marshal is there but no real work is done. End nodes are passed back. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21Move some methods inline.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Constify all references to Stmt* and CFGBlock* in libChecker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Constify.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20remove const_cast.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20constify.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Constify.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19remove CallInliner.cpp.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Add double close check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108669 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Reapply r108617.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Revert r108617, it broke the build.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Prepare the analyzer for the callee in another translation unit:Zhongxing Xu
Let AnalysisContext contain a TranslationUnit. Let CallEnter refer to an AnalysisContext instead of a FunctionDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by ↵Ted Kremenek
removing a bogus assertion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Fix APFloat assertion failure in IdempotentOperationChecker resulting in havingTed Kremenek
an APFloat with different "float semantics" than the compared float literal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16Improved false positive rate for the idempotent operations checker and moved ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Pass StringRefs by value.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08Cleanup in CStringChecker. Now properly bifurcates the state for ↵Jordy Rose
zero/nonzero sizes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor
suppressing copies of objects with trivial copy constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor
breaking bootstrap on Linux. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor
newly-narrowed scope. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Simplify code and remove comment that is no longer relevant.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Remove Decl::getCompoundBody().Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis
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". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Add memcmp() and bcmp() to CStringChecker. These check for valid access to ↵Jordy Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107761 91177308-0d34-0410-b5e6-96231b3b80d8