summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
Commit message (Collapse)AuthorAgeFilesLines
* Remove RegionStoreManager::evalBinOp(), which is now handled by the SValBuilder.Ted Kremenek2011-02-111-119/+0
| | | | llvm-svn: 125396
* Rename 'InvalidateRegions()' to 'invalidateRegions()'.Ted Kremenek2011-02-119-30/+28
| | | | llvm-svn: 125395
* Allow the 'Eng' entry in GRStateManager to be a (possibly null) pointer ↵Ted Kremenek2011-02-111-9/+11
| | | | | | instead of a reference. llvm-svn: 125362
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-102-4/+0
| | | | llvm-svn: 125275
* Run ~GRState() when reclaiming GRStates.Ted Kremenek2011-02-101-0/+1
| | | | llvm-svn: 125262
* static analyzer: Make GRStates reference counted, with reference counts ↵Ted Kremenek2011-02-101-0/+2
| | | | | | | | managed by ExplodedNodes. This reduces memory usage of the analyzer on sqlite by another 5%. llvm-svn: 125260
* Split 'include/clang/StaticAnalyzer' into ↵Ted Kremenek2011-02-1082-212/+212
| | | | | | | | '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-094-4/+121
| | | | | | | | | | | | 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, retain/release checker: Remove hack where objects passed in ↵Ted Kremenek2011-02-081-18/+0
| | | | | | message to 'self' are no longer tracked. llvm-svn: 125130
* [analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.Argyrios Kyrtzidis2011-02-0839-47/+64
| | | | | | | 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-0811-12/+12
| | | | | | 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-022-2/+2
| | | | | | | 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
* Wire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ↵Ted Kremenek2011-01-271-1/+34
| | | | | | ObjC retain/release checker. llvm-svn: 124386
* [analyzer] Fix crash when handling dot syntax on 'super'.Argyrios Kyrtzidis2011-01-271-6/+6
| | | | llvm-svn: 124376
* Fix whitespace.NAKAMURA Takumi2011-01-271-1/+0
| | | | llvm-svn: 124364
* 7bit-ize.NAKAMURA Takumi2011-01-271-2/+2
| | | | llvm-svn: 124363
* Hook up attribute ns_consumes_self in the ObjC retain/release checker in the ↵Ted Kremenek2011-01-271-0/+9
| | | | | | static analyzer. llvm-svn: 124360
* [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
* Don't try and symbolicate unions; we don't reasonTed Kremenek2011-01-251-1/+3
| | | | | | about them yet. Fixes crash reported in PR 9049. llvm-svn: 124228
* Recycle memory for GRStates that are never referencedTed Kremenek2011-01-252-4/+27
| | | | | | | | 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-256-11/+80
| | | | | | | | | | 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-258-171/+289
| | | | | | | | | | 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
* Use CharUnits for the offset amount of RegionRawOffset.Ken Dyck2011-01-244-6/+6
| | | | llvm-svn: 124093
* 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-194-5/+5
| | | | | | 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-182-9/+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-148-28/+28
| | | | llvm-svn: 123460
* Rename 'EnterStackFrame()' to 'enterStackFrame()'.Ted Kremenek2011-01-144-6/+6
| | | | llvm-svn: 123459
* Teach RegionStore::EnterStackFrame() to handleTed Kremenek2011-01-141-4/+7
| | | | | | | | | | | the case where the called function has fewer formal arguments than actual arguments. This fixes a crash in the analyzer when doing function call inlining. Patch by Zhenbo Xu! llvm-svn: 123458
* 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
* CXXBaseObjectRegion is like FieldRegion. Need to blast through it whenZhongxing Xu2011-01-131-0/+1
| | | | | | getting the base region. This makes the RemoveDeadBindings() correct. llvm-svn: 123375
* Support inlining base initializers. We still haven't got it completely right,Zhongxing Xu2011-01-132-12/+39
| | | | | | | since the bindings are purged after they are set up. Need to investigate RemoveDeadBindings algorithm. llvm-svn: 123374
* Fix a corner case in RegionStore where we assignTed Kremenek2011-01-131-2/+27
| | | | | | | | | | | | | a struct value to a symbolic index into array. RegionStore can't actually reason about this, so we were getting bogus warnings about loading uninitialized values from the array. The solution is invalidate the entire array when we cannot represent the binding explicitly. Fixes <rdar://problem/8848957> llvm-svn: 123368
OpenPOWER on IntegriCloud