summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Do not run visitors until the fixpoint, run only once.George Karpenkov2018-06-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation, we run visitors until the fixed point is reached. That is, if a visitor adds another visitor, the currently processed path is destroyed, all diagnostics is discarded, and it is regenerated again, until it's no longer modified. This pattern has a few negative implications: - This loop does not even guarantee to terminate. E.g. just imagine two visitors bouncing a diagnostics around. - Performance-wise, e.g. for sqlite3 all visitors are being re-run at least 10 times for some bugs. We have already seen a few reports where it leads to timeouts. - If we want to add more computationally intense visitors, this will become worse. - From architectural standpoint, the current layout requires copying visitors, which is conceptually wrong, and can be annoying (e.g. no unique_ptr on visitors allowed). The proposed change is a much simpler architecture: the outer loop processes nodes upwards, and whenever the visitor is added it only processes current nodes and above, thus guaranteeing termination. Differential Revision: https://reviews.llvm.org/D47856 llvm-svn: 335666
* [clang] Remove redundant return [NFC]Mandeep Singh Grang2017-11-131-2/+0
| | | | | | | | | | | | | | Reviewers: rsmith, sfantao, mcrosier Reviewed By: mcrosier Subscribers: jholewinski, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39915 llvm-svn: 318074
* Migrate PathDiagnosticPiece to std::shared_ptrDavid Blaikie2017-01-051-9/+9
| | | | | | | Simplifies and makes explicit the memory ownership model rather than implicitly passing/acquiring ownership. llvm-svn: 291143
* [analyzer] Fix capitalization in ObjCSuperDealloc checker diagnostic.Devin Coughlin2016-11-011-1/+1
| | | | | | | | | Change "use of 'self'..." to "Use of 'self'...". The convention is to start diagnostics with a capital letter. rdar://problem/28322494 llvm-svn: 285759
* Move class into anonymous namespace. NFC.Benjamin Kramer2016-03-041-0/+2
| | | | llvm-svn: 262716
* [analyzer] Fix capitalization in ObjCSuperDeallocChecker diagnostic.Devin Coughlin2016-03-021-1/+1
| | | | llvm-svn: 262520
* [analyzer] Prune some incorrect \param doc comment annotations.Devin Coughlin2016-02-261-3/+3
| | | | llvm-svn: 261970
* [analyzer] Shorten ObjcSuperDeallocChecker diagnostics.Devin Coughlin2016-02-261-2/+2
| | | | | | | | | Change "use of 'self' after it has been freed with call to [super dealloc]" to "use of 'self' after it has been deallocated" and "use of instance variable '_ivar' after the instance has been freed with call to [super dealloc]" to "use of instance variable '_ivar' after 'self' has been deallocated". llvm-svn: 261945
* [analyzer] Fix a memory error in r261935 caught by the Windows bots.Devin Coughlin2016-02-261-2/+2
| | | | | | It was using a temporary StringRef after its underlying storage was freed. llvm-svn: 261944
* [analyzer] Warn on use of 'self' after call to to [super dealloc].Devin Coughlin2016-02-251-24/+119
| | | | | | | | | | | | Referring to 'self' after a call to [super dealloc] is a use-after-free in Objective-C because NSObject's -dealloc frees the memory pointed to by self. This patch extends the ObjCSuperDeallocChecker to catch this error. rdar://problem/6953275 Differential Revision: http://reviews.llvm.org/D17528 llvm-svn: 261935
* [analyzer] Detect duplicate [super dealloc] callsDevin Coughlin2016-02-221-0/+197
Add an alpha path checker that warns about duplicate calls to [super dealloc]. This will form the foundation of a checker that will detect uses of 'self' after calling [super dealloc]. Part of rdar://problem/6953275. Based on a patch by David Kilzer! Differential Revision: http://reviews.llvm.org/D5238 llvm-svn: 261545
OpenPOWER on IntegriCloud