summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Cleanup on CStringChecker and its associated tests. Also check for null ↵Jordy Rose2010-07-071-8/+77
| | | | | | arguments...which are allowed if the access length is 0! llvm-svn: 107759
* Change explicit handling of impossible condition to call llvm_unreachable in ↵Tom Care2010-07-071-2/+2
| | | | | | IdempotentOperationChecker::PreVisitBinaryOperator. llvm-svn: 107748
* Silence an annoying GCC warning about use of an uninitialized variable. EvenChandler Carruth2010-07-071-1/+1
| | | | | | | making the other switch case unreachable, or sinking the 'continue' into it doesn't silence this. llvm-svn: 107745
* Use 'llvm_unreachable' to mark impossible code paths so that GCC doesn'tChandler Carruth2010-07-071-1/+2
| | | | | | consider them for warnings. llvm-svn: 107741
* Fix casts in RegionStore to not always assume that bindings are only to ↵Ted Kremenek2010-07-061-4/+4
| | | | | | | | SubRegions. Fixes assertion failure reported in PR 7572. llvm-svn: 107738
* Implement dumpToStream() for NonStaticGlobalSpaceRegion and ↵Ted Kremenek2010-07-061-1/+8
| | | | | | StaticGlobalSpaceRegion. llvm-svn: 107731
* Add comment noting VLASizeChecker's duty in defining a VLA's extent.Jordy Rose2010-07-061-0/+6
| | | | llvm-svn: 107728
* Add a new path-sensitive checker for functions in <string.h>, for both ↵Jordy Rose2010-07-064-0/+361
| | | | | | null-terminated strings and memory blocks. Currently only checks memcpy(), memmove(), and bcopy(), but this is intended to be expanded soon. llvm-svn: 107722
* Sort CMake file.Ted Kremenek2010-07-061-9/+9
| | | | llvm-svn: 107709
* Added a path-sensitive idempotent operation checker ↵Tom Care2010-07-065-3/+466
| | | | | | | | | | | | | | | | | | | (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect. Example: { int a = 1; int b = 5; int c = b / a; // a is 1 on all paths } - New IdempotentOperationChecker class - Moved recursive Stmt functions in r107675 to IdempotentOperationChecker - Minor refactoring of SVal to allow checking for any integer - Added command line option for check - Added basic test cases llvm-svn: 107706
* Add an assertion.Zhongxing Xu2010-07-061-0/+3
| | | | llvm-svn: 107645
* Remove the now-unused GRState::isEqual method. Instead of asking if an ↵Jordy Rose2010-07-061-25/+0
| | | | | | expression equals a certain value, use SValuator::EvalEQ and GRState::Assume to see if it can, must, or must not equal that value. llvm-svn: 107638
* Improve NULL-checking for CFRetain/CFRelease. We now remember that the ↵Jordy Rose2010-07-062-44/+52
| | | | | | argument was non-NULL, and we report where the null assumption came from (like AttrNonNullChecker already did). llvm-svn: 107633
* Support sizeof for VLA expressions (sizeof(someVLA)). sizeof(int[n]) still ↵Jordy Rose2010-07-051-3/+32
| | | | | | unimplemented. A VLA region's sizeof value matches its extent. llvm-svn: 107611
* Track extents for VLAs.Jordy Rose2010-07-052-7/+38
| | | | llvm-svn: 107603
* Add a new symbol type, SymbolExtent, to represent the extents of memory ↵Jordy Rose2010-07-047-133/+148
| | | | | | | | | | regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals. Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited. The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking. llvm-svn: 107577
* Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for ↵Ted Kremenek2010-07-017-187/+358
| | | | | | | | | | | non-static global variables when calling a function/method whose impact on global variables we cannot accurately estimate. This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily determining the value of a global. llvm-svn: 107423
* Add an ivar to SymbolReaper for the current statement, and then stop passing ↵Jordy Rose2010-07-019-27/+24
| | | | | | the current statement around everywhere. Preparation for symbolic extents. llvm-svn: 107422
* ExplodedGraph never uses ASTContext, remove it.Zhongxing Xu2010-07-012-4/+4
| | | | llvm-svn: 107388
* Correctly implement the CheckerVisit optimization introduced in r106884, but ↵Ted Kremenek2010-06-301-1/+1
| | | | | | this time actually used the cached checker list when calling back to Checker visit methods. This reduces the analysis time for sqlite3.c by 8%. llvm-svn: 107259
* Pointers casted as integers still count as locations to SimpleSValuator, so ↵Jordy Rose2010-06-301-1/+6
| | | | | | don't crash if we do a funny thing like ((int)ptr)&1. Fixes PR7527. llvm-svn: 107236
* Tweaker Checker::VisitEndAnalysis to have 'hasWorkRemaining' alsoTed Kremenek2010-06-291-2/+5
| | | | | | | be true if some paths were aborted because they exceeded the maximum loop unrolling count. llvm-svn: 107209
* llvm::errs() is non-buffered, so it doesn't need to be flushed.Dan Gohman2010-06-281-2/+2
| | | | llvm-svn: 107012
* Pointer comparisons (and pointer-pointer subtraction). Basically filling in ↵Jordy Rose2010-06-283-58/+322
| | | | | | SimpleSValuator::EvalBinOpLL(). llvm-svn: 106992
* Implicitly compare symbolic expressions to zero when they're being used as ↵Jordy Rose2010-06-271-3/+7
| | | | | | constraints. Part of PR7491. llvm-svn: 106972
* Allow '__extension__' to be analyzed in a lvalue context.Ted Kremenek2010-06-261-2/+6
| | | | llvm-svn: 106964
OpenPOWER on IntegriCloud