summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable ↵Jordy Rose2011-08-211-46/+94
| | | | | | from CFRefCount to RetainReleaseChecker. No intended functionality change. llvm-svn: 138223
* [analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to ↵Jordy Rose2011-08-211-1/+0
| | | | | | return its receiver and pretending that it does won't actually buy us anything. (Comment change only.) llvm-svn: 138221
* [analyzer] Migrate return value handling from CFRefCount to ExprEngine. This ↵Jordy Rose2011-08-213-67/+98
| | | | | | seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely. llvm-svn: 138220
* [analyzer] Replace calls to getNameAsString() with StringRef equivalents.Jordy Rose2011-08-214-16/+15
| | | | llvm-svn: 138215
* Fix compile on platforms that don't implicitly include stdarg.h here.Benjamin Kramer2011-08-201-1/+1
| | | | llvm-svn: 138214
* [analyzer] RetainReleaseChecker always wants region change updates. There's ↵Jordy Rose2011-08-201-6/+2
| | | | | | no need for a flag, at least not right now. llvm-svn: 138212
* Fix indentation.Jordy Rose2011-08-201-17/+17
| | | | llvm-svn: 138211
* [analyzer] Move handling of hardcoded noreturn ("panic") methods from ↵Jordy Rose2011-08-202-38/+71
| | | | | | CFRefCount to NoReturnFunctionChecker. No functionality change intended. llvm-svn: 138210
* [analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. ↵Ted Kremenek2011-08-203-7/+6
| | | | | | No need to bind an explicit value and create a new node. llvm-svn: 138196
* [analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive ↵Ted Kremenek2011-08-201-121/+113
| | | | | | visit to subexpressions (which is no longer needed). llvm-svn: 138195
* Start partitioning ExprEngine.cpp into separate .cpp files that handle ↵Ted Kremenek2011-08-205-1187/+1202
| | | | | | | | different parts of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on). llvm-svn: 138194
* Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.Ted Kremenek2011-08-202-2/+2
| | | | llvm-svn: 138193
* Static Analyzer Diagnostics: Move the responsibility for generating the ↵Anna Zaks2011-08-203-65/+100
| | | | | | endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece. llvm-svn: 138184
* Remove dead code.Ted Kremenek2011-08-201-12/+0
| | | | llvm-svn: 138183
* Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. ↵Anna Zaks2011-08-192-22/+34
| | | | | | BugReport no longer needs to inherit from BugReporterVisitor. llvm-svn: 138142
* Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks2011-08-1918-360/+255
| | | | | | | | | | | | API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. llvm-svn: 138126
* Fix a memory leak in the analyzer - BugReports didn't get freed. Plus, ↵Anna Zaks2011-08-191-4/+14
| | | | | | remove invalid assert from the destructor which wasn't called previously due to the leak. llvm-svn: 138027
* Static Analyzer Diagnostics: Move custom diagnostic visitors from ↵Anna Zaks2011-08-183-69/+82
| | | | | | | | BugReporterContext to BugReport. One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null. llvm-svn: 138001
* Remove DiagBugReport by pulling it into its parent BugReport.Anna Zaks2011-08-171-2/+10
| | | | llvm-svn: 137899
* Remove EnhancedBugReport and RangedBugReport - pull all the extra ↵Anna Zaks2011-08-1734-97/+117
| | | | | | functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME. llvm-svn: 137894
* [analyzer] Migrate assumption and binding handling from CFRefCount to ↵Jordy Rose2011-08-171-100/+94
| | | | | | RetainReleaseChecker. This is mostly a textual move and required no supporting changes. No functionality change intended. llvm-svn: 137874
* Fix a handful of dead stores found by Clang's static analyzer. There's a ↵Ted Kremenek2011-08-171-3/+2
| | | | | | bunch of others I haven't touched. llvm-svn: 137867
* Fix typo.Jordy Rose2011-08-171-1/+1
| | | | llvm-svn: 137814
* [analyzer] Add a warning for an incompatible plugin version.Jordy Rose2011-08-171-6/+28
| | | | llvm-svn: 137813
* Silence compiler warnings by casting object pointers to function pointers ↵Benjamin Kramer2011-08-171-1/+2
| | | | | | | | via intptr_t. This is ugly but ISO C++ doesn't allow direct casts. llvm-svn: 137812
* [analyzer] Add basic support for pluggable checkers.Jordy Rose2011-08-171-11/+49
| | | | llvm-svn: 137802
* [analyzer] teach ExprEngine about loads from static C++ class fields. Fixes ↵Ted Kremenek2011-08-161-1/+8
| | | | | | <rdar://problem/9948787>. llvm-svn: 137760
* [analyzer] Overhaul of checker registration in preparation for basic plugin ↵Jordy Rose2011-08-1612-353/+223
| | | | | | support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages). llvm-svn: 137758
* MacOSKeychainAPIChecker: Turn it on by default.Anna Zaks2011-08-161-7/+3
| | | | llvm-svn: 137740
* MacOSKeychainAPIChecker: Do not report double allocation if first allocation ↵Anna Zaks2011-08-161-17/+19
| | | | | | returned an error. llvm-svn: 137720
* [analyzer] Enhance ConditionVisitor to handle arbitrary ValueDecls in binary ↵Ted Kremenek2011-08-161-13/+34
| | | | | | expressions, and also handle inverting the order of comparison when the named decl appears on the RHS. llvm-svn: 137714
* [analyzer] fix operation inversion calculation in ConditionVisitor.Ted Kremenek2011-08-161-1/+1
| | | | llvm-svn: 137708
* [analyzer] Enhance ConditionVisitor to understand eagerly evaluated (simple) ↵Ted Kremenek2011-08-161-14/+129
| | | | | | binary conditions, and teach it to only focus on constraint changes. llvm-svn: 137705
* [analyzer] add ExprEngine::getEagerlyAssumedTags() to allow externally ↵Ted Kremenek2011-08-161-7/+17
| | | | | | querying of "eagerly assumed" expressions. llvm-svn: 137704
* [analyzer] Remove PostStmtCustom ProgramPoint. It can be represented using ↵Ted Kremenek2011-08-162-15/+10
| | | | | | tagged PostStmts. llvm-svn: 137697
* MacOSKeychainAPIChecker: The security API/memory leak checker should always ↵Anna Zaks2011-08-151-10/+17
| | | | | | generate regular nodes instead of sink nodes. llvm-svn: 137681
* Add ProgramState.cpp.Ted Kremenek2011-08-151-0/+662
| | | | llvm-svn: 137677
* Rename GRState to ProgramState, and cleanup some code formatting along the way.Ted Kremenek2011-08-1556-1360/+811
| | | | llvm-svn: 137665
* MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as ↵Anna Zaks2011-08-151-7/+7
| | | | | | per code review for r137523). llvm-svn: 137633
* Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek2011-08-1241-611/+611
| | | | | | and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. llvm-svn: 137537
* [analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.Ted Kremenek2011-08-128-43/+99
| | | | | | | Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior. For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner. llvm-svn: 137529
* MacOSKeychainAPIChecker: If the allocated data address entered as an ↵Anna Zaks2011-08-121-0/+5
| | | | | | enclosing function parameter, skip it to avoid false positives. llvm-svn: 137526
* MacOSKeychainAPIChecker: Anna Zaks2011-08-121-38/+150
| | | | | | | | Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope. Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead. llvm-svn: 137523
* [analyzer] Nitpicks on Olaf's patch, which I meant to e-mail but then didn't inJordy Rose2011-08-121-3/+2
| | | | | | time. One is cleanup, the other is me being OCD about enum group nesting. llvm-svn: 137517
* MacOSKeychainAPIChecker: There is no need to use SymbolMetadata to represent ↵Anna Zaks2011-08-121-44/+70
| | | | | | | | the allocated data symbol, we can just use the symbol corresponding to the SymbolicRegion. This simplifies tracking of the symbol, for example, SymbolMetadata needs to go through extra hoops to stay alive. Make AllocationState internal to the MacOSKeychainAPIChecker class. llvm-svn: 137514
* [analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can ↵Ted Kremenek2011-08-1212-50/+55
| | | | | | | | separate TypedRegions that implement getValueType() from those that don't. Patch by Olaf Krzikalla! llvm-svn: 137498
* Optimizations for Dependent Symbol tracking (as per Ted's code review for ↵Anna Zaks2011-08-121-8/+27
| | | | | | | | | | r137309): 1) Change SymbolDependTy map to keep pointers as data. And other small tweaks like making the DenseMap smaller 64->16 elements; remove removeSymbolDependencies() as it will probably not be used. 2) Do not mark dependents live more then once. llvm-svn: 137401
* Analyzer Core: Adding support for user-defined symbol dependencies. (For ↵Anna Zaks2011-08-111-1/+30
| | | | | | example, the allocated resource symbol only needs to be freed if no error has been returned by the allocator, so a checker might want to make the lifespan of the error code symbol depend on the allocated resource symbol.) Note, by default, the map that holds the dependencies will get destroyed along with the SymbolManager at the end of function exploration. llvm-svn: 137309
* Cleanup: remove CleanedSate member and GetState() wrapper from ↵Anna Zaks2011-08-114-8/+7
| | | | | | StmtNodeBuilder, not needed as of r137273. llvm-svn: 137284
* Cleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.Anna Zaks2011-08-102-56/+56
| | | | llvm-svn: 137279
OpenPOWER on IntegriCloud