summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
Commit message (Collapse)AuthorAgeFilesLines
* Teach the IdempotentOperations checker to ignore property setters.Ted Kremenek2011-02-121-2/+9
| | | | llvm-svn: 125443
* Weaken the ObjCSelfInitChecker to only warn when one calls an 'init' method ↵Ted Kremenek2011-02-121-7/+22
| | | | | | within an 'init' method. This is a temporary stop gap to avoid false positives while we investigate how to make it smarter. llvm-svn: 125427
* Don't emit a dead store for '++' operations unless it occurs with a return ↵Ted Kremenek2011-02-121-6/+5
| | | | | | | | statement. We've never seen any other cases that were real bugs. Fixes <rdar://problem/6962292>. llvm-svn: 125419
* Don't report dead stores on unreachable code paths. Fixes ↵Ted Kremenek2011-02-111-5/+61
| | | | | | <rdar://problem/8405222>. llvm-svn: 125415
* Rename 'InvalidateRegions()' to 'invalidateRegions()'.Ted Kremenek2011-02-111-1/+1
| | | | llvm-svn: 125395
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | llvm-svn: 125275
* Split 'include/clang/StaticAnalyzer' into ↵Ted Kremenek2011-02-1049-139/+139
| | | | | | | | 'include/clang/StaticAnalyzer/Core' and 'include/clang/StaticAnalyzer/Checkers'. This layout matches lib/StaticAnalyzer, which corresponds to two StaticAnalyzer libraries. llvm-svn: 125251
* AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actionsPeter Collingbourne2011-02-091-0/+1
| | | | llvm-svn: 125217
* Remove vtables from the Stmt hierarchy; this was pretty easy asJohn McCall2011-02-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | there were only three virtual methods of any significance. The primary way to grab child iterators now is with Stmt::child_range children(); Stmt::const_child_range children() const; where a child_range is just a std::pair of iterators suitable for being llvm::tie'd to some locals. I've left the old child_begin() and child_end() accessors in place, but it's probably a substantial penalty to grab the iterators individually now, since the switch-based dispatch is kindof inherently slower than vtable dispatch. Grabbing them together is probably a slight win over the status quo, although of course we could've achieved that with vtables, too. I also reclassified SwitchCase (correctly) as an abstract Stmt class, which (as the first such class that wasn't an Expr subclass) required some fiddling in a few places. There are somewhat gross metaprogramming hooks in place to ensure that new statements/expressions continue to implement getSourceRange() and children(). I had to work around a recent clang bug; dgregor actually fixed it already, but I didn't want to introduce a selfhosting dependency on ToT. llvm-svn: 125183
* static analyzer: Further reduce the analyzer's memory usage when analyzing ↵Ted Kremenek2011-02-092-1/+9
| | | | | | | | | | | | sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes. The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain practically no difference between the predecessor and successor nodes. For example, if the state is different between a predecessor and a node, the node is left in. Only for the 'environment' component of the state do we not care if the ExplodedNodes are different. This paves the way for future optimizations where we can reclaim the environment objects. llvm-svn: 125154
* [analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.Argyrios Kyrtzidis2011-02-082-0/+124
| | | | | | | Eventually there will also be a lib/StaticAnalyzer/Frontend that will handle initialization and checker registration. Yet another library to avoid cyclic dependencies between Core and Checkers. llvm-svn: 125124
* [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> ↵Argyrios Kyrtzidis2011-02-082-1/+1
| | | | | | lib/StaticAnalyzer/Checkers/ExperimentalChecks.cpp llvm-svn: 125123
* [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> ↵Argyrios Kyrtzidis2011-02-0810-11/+11
| | | | | | lib/StaticAnalyzer/Checkers/ExperimentalChecks.h llvm-svn: 125122
* [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> ↵Argyrios Kyrtzidis2011-02-0832-32/+32
| | | | | | lib/StaticAnalyzer/Checkers/InternalChecks.h llvm-svn: 125121
* [analyzer] Fix a false positive of the 'self' initialization checker.Argyrios Kyrtzidis2011-02-051-4/+20
| | | | | | | | | | | | | | | | | | | A common pattern in classes with multiple initializers is to put the subclass's common initialization bits into a static function that receives the value of 'self', e.g: if (!(self = [super init])) return nil; if (!(self = _commonInit(self))) return nil; It was reported that 'self' was not set to the result of [super init]. Until we can use inter-procedural analysis, in such a call, transfer the ObjCSelfInitChecker flags associated with 'self' to the result of the call. Fixes rdar://8937441 & http://llvm.org/PR9094 llvm-svn: 124940
* [analyzer] Fix a crash until we can handle temporary struct objects properly.Argyrios Kyrtzidis2011-02-031-1/+5
| | | | llvm-svn: 124822
* An insomniac stab at making block declarations list the variables they closeJohn McCall2011-02-021-1/+1
| | | | | | | on, as well as more reliably limiting invalid references to locals from nested scopes. llvm-svn: 124721
* Fix the message. Thanks to Thomas Clement for noticing.Argyrios Kyrtzidis2011-02-011-1/+1
| | | | llvm-svn: 124680
* [analyzer] Slightly improve the diagnostic message of ObjCSelfInitChecker.Argyrios Kyrtzidis2011-02-011-2/+2
| | | | llvm-svn: 124674
* [analyzer] Fix crash when handling dot syntax on 'super'.Argyrios Kyrtzidis2011-01-271-6/+6
| | | | llvm-svn: 124376
* [analyzer] Enable the self-init checker under command-line option ↵Argyrios Kyrtzidis2011-01-262-1/+3
| | | | | | | | '-analyzer-check-objc-self-init' which by default is enabled by the driver for '--analyze'. llvm-svn: 124266
* [analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!Argyrios Kyrtzidis2011-01-261-4/+6
| | | | llvm-svn: 124263
* [analyzer] Do the self-init check only on NSObject subclasses. Patch by ↵Argyrios Kyrtzidis2011-01-251-2/+14
| | | | | | Jean-Daniel Dupas! llvm-svn: 124249
* Recycle memory for GRStates that are never referencedTed Kremenek2011-01-251-0/+3
| | | | | | | | by ExplodedNodes. This leads to about a 4-8% reduction in memory footprint when analyzing functions in sqlite3. llvm-svn: 124214
* Tweak wording of static analyzer diagnosticTed Kremenek2011-01-251-3/+3
| | | | | | | for a block capturing the value of an uninitialized variable. llvm-svn: 124212
* [analyzer] Handle the dot syntax for properties in the ExprEngine.Argyrios Kyrtzidis2011-01-252-9/+56
| | | | | | | | | | We translate property accesses to obj-c messages by simulating "loads" or "stores" to properties using a pseudo-location SVal kind (ObjCPropRef). Checkers can now reason about obj-c messages for both explicit message expressions and implicit messages due to property accesses. llvm-svn: 124161
* [analyzer] Introduce ExprEngine::VisitObjCMessage for handling general ↵Argyrios Kyrtzidis2011-01-251-12/+19
| | | | | | | | ObjCMessages (both message expressions and property access) and use it in ExprEngine::VisitObjCMessageExpr. llvm-svn: 124160
* [analyzer] Introduce ObjCMessage which represents both explicit ObjC message ↵Argyrios Kyrtzidis2011-01-255-99/+136
| | | | | | | | | | expressions and implicit messages that are sent for handling properties in dot syntax. Replace all direct uses of ObjCMessageExpr in the checkers and checker interface with ObjCMessage. llvm-svn: 124159
* [analyzer] Simplify GetReceiverType function in ↵Argyrios Kyrtzidis2011-01-251-18/+2
| | | | | | BasicObjCFoundationChecks.cpp; no functionality change. llvm-svn: 124157
* Enhance AnalysisConsumer to also visit functionsTed Kremenek2011-01-201-39/+47
| | | | | | and methods defined within 'namespace X { ... }'. llvm-svn: 123921
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-192-3/+3
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-3/+0
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* NetBSD, OpenBSD, and Dragonfly BSD also have arc4random. Patch fromDouglas Gregor2011-01-171-1/+4
| | | | | | Joerg Sonnenberger! llvm-svn: 123669
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-151-0/+1
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Cleanup confused code that redundantly called "getDeclContext()" twice.Ted Kremenek2011-01-141-3/+1
| | | | | | Found by clang static analyzer. llvm-svn: 123485
* Rename 'RemoveDeadBindings()' to 'removeDeadBindings()'Ted Kremenek2011-01-141-1/+1
| | | | llvm-svn: 123460
* Rename 'EnterStackFrame()' to 'enterStackFrame()'.Ted Kremenek2011-01-141-1/+1
| | | | llvm-svn: 123459
* Rename 'CheckDeadStores.cpp' to 'DeadStoresChecker.cpp'.Ted Kremenek2011-01-132-1/+1
| | | | llvm-svn: 123395
* Remove warning in dead stores checker forTed Kremenek2011-01-131-6/+5
| | | | | | | | dead stores within nested assignments. I have never seen an actual bug found by this specific warning, and it can lead to many false positives. llvm-svn: 123394
* Support inlining base initializers. We still haven't got it completely right,Zhongxing Xu2011-01-131-9/+25
| | | | | | | since the bindings are purged after they are set up. Need to investigate RemoveDeadBindings algorithm. llvm-svn: 123374
* Rename 'HasGeneratedNode' to 'hasGeneratedNode'Ted Kremenek2011-01-131-17/+14
| | | | | | | | | and 'getBasePredecessor()' to 'getPredecessor()'. Also remove a unneeded save-and-restore of node builder's tag field. llvm-svn: 123363
* Remove unnecessary save-and-restore of theTed Kremenek2011-01-133-3/+1
| | | | | | node builder's 'HasGeneratedNode' field. llvm-svn: 123362
* [analyzer] Introduce ObjCSelfInitChecker, which checks initialization ↵Argyrios Kyrtzidis2011-01-114-0/+309
| | | | | | | | | methods to verify that they assign 'self' to the result of an initialization call (e.g. [super init], or [self initWith..]) before using any instance variable or returning 'self'. llvm-svn: 123264
* [analyzer] Support post-visiting ObjCIvarRefExprs for checkers.Argyrios Kyrtzidis2011-01-111-1/+7
| | | | llvm-svn: 123263
* [analyzer] Add 'isLoad' parameter in Checker::visitLocation() to ↵Argyrios Kyrtzidis2011-01-114-8/+11
| | | | | | conveniently distinguish between loads/stores. llvm-svn: 123261
* Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().Ted Kremenek2011-01-111-3/+1
| | | | llvm-svn: 123240
* Rework ExprEngine::processCFGBlockEntrance()Ted Kremenek2011-01-111-5/+16
| | | | | | | | to use a node builder. This paves the way for Checkers to interpose (via a "visit" method) at the entrance to blocks. llvm-svn: 123217
* Rename misc. methods in ento::Worklist to startTed Kremenek2011-01-111-2/+2
| | | | | | with lowercase letter. llvm-svn: 123212
* Rename misc. methods in GRSubEngine to startTed Kremenek2011-01-115-25/+25
| | | | | | with a lower-case letter. No functionality change. llvm-svn: 123211
* Fix CMakeLists.txt.Zhongxing Xu2011-01-101-0/+2
| | | | llvm-svn: 123167
OpenPOWER on IntegriCloud