summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] NFC: Move PathDiagnostic classes to libAnalysis.Artem Dergachev2019-09-111-1/+1
| | | | | | | | | | | | At this point the PathDiagnostic, PathDiagnosticLocation, PathDiagnosticPiece structures no longer rely on anything specific to Static Analyzer, so we can move them out of it for everybody to use. PathDiagnosticConsumers are still to be handed off. Differential Revision: https://reviews.llvm.org/D67419 llvm-svn: 371661
* [analyzer] NFC: Change evalCall() to provide a CallEvent.Artem Dergachev2019-06-191-1/+1
| | | | | | | | | | | | This changes the checker callback signature to use the modern, easy to use interface. Additionally, this unblocks future work on allowing checkers to implement evalCall() for calls that don't correspond to any call-expression or require additional information that's only available as part of the CallEvent, such as C++ constructors and destructors. Differential Revision: https://reviews.llvm.org/D62440 llvm-svn: 363893
* [analyzer] [RetainCountChecker] Track input parameters to the top-level functionGeorge Karpenkov2019-01-291-0/+3
| | | | | | | | | | Track them for ISL/OS objects by default, and for NS/CF under a flag. rdar://47536377 Differential Revision: https://reviews.llvm.org/D57356 llvm-svn: 352534
* [analyzer] Port RetainSummaryManager to the new AnyCall interface, decouple ↵George Karpenkov2019-01-251-10/+4
| | | | | | | | | | ARCMT from the analyzer rdar://19694750 Differential Revision: https://reviews.llvm.org/D57127 llvm-svn: 352149
* [analyzer] Insert notes in RetainCountChecker where our dynamic cast ↵George Karpenkov2019-01-221-1/+11
| | | | | | | | | | modeling assumes 'null' output rdar://47397214 Differential Revision: https://reviews.llvm.org/D56952 llvm-svn: 351865
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Revert "Fix failing MSan bots"George Karpenkov2019-01-181-9/+13
| | | | | | | | This reverts commit 2cedaaef383d8d6142046074ffebc2bb5a914778. Revert with a fix. llvm-svn: 351575
* Fix failing MSan botsVlad Tsyrklevich2019-01-181-13/+9
| | | | | | | Revert r351508-351514, this block of changes introduced a consistent MSan failure on the sanitizer bots. llvm-svn: 351528
* [analyzer] Introduce proper diagnostic for freeing unowned objectGeorge Karpenkov2019-01-181-2/+3
| | | | | | | | Insert a note when the object becomes not (exclusively) owned. Differential Revision: https://reviews.llvm.org/D56891 llvm-svn: 351514
* [analyzer] [NFC] Clean up messy handling of bug categories in RetainCountCheckerGeorge Karpenkov2019-01-181-9/+12
| | | | | | https://reviews.llvm.org/D56887 llvm-svn: 351512
* [analyzer] [NFC] Yet another minor cleanup of RetainCountCheckerGeorge Karpenkov2019-01-161-5/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D56744 llvm-svn: 351393
* [analyzer] [NFC] Remove unused undefined method.George Karpenkov2019-01-141-2/+0
| | | | | | Wow, at no point the linker or compiler complaints about that! llvm-svn: 351096
* [analyzer] Update the category name for RetainCountChecker reportsGeorge Karpenkov2019-01-101-7/+6
| | | | | | | | | | ..now that it includes OSObjects rdar://46509986 Differential Revision: https://reviews.llvm.org/D56404 llvm-svn: 350869
* [analyzer] [NFC] [RetainCountChecker] Remove dead unused mapGeorge Karpenkov2019-01-101-6/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D56402 llvm-svn: 350868
* [analyzer] [RetainCountChecker] [NFC] Remove SummaryLogGeorge Karpenkov2019-01-101-9/+2
| | | | | | | | | | | | | | The complicated machinery for passing the summary log around is actually only used for one thing! To figure out whether the "dealloc" message was sent. Since I have tried to extend it for other uses and failed (it's actually very hard to use), I think it's much better to simply use a tag and remove the summary log altogether. Differential Revision: https://reviews.llvm.org/D56228 llvm-svn: 350864
* [analyzer] [RetainCountChecker] [NFC] Remove redundant enum items *Msg, as ↵George Karpenkov2019-01-101-1/+1
| | | | | | | | the object type is already communicated by a separate field Differential Revision: https://reviews.llvm.org/D56070 llvm-svn: 350859
* [analyzer] [NFC] Track object type with ArgEffect in RetainCountChecker.George Karpenkov2019-01-101-1/+1
| | | | | | | | This would be needed in the future. https://reviews.llvm.org/D56040 llvm-svn: 350858
* [analyzer] [NFC] Move ObjKind into a separate top-level enum in ↵George Karpenkov2019-01-101-6/+6
| | | | | | | | | | RetainSummaryManager. Allows using it in future outside of RetEffect. Differential Revision: https://reviews.llvm.org/D56039 llvm-svn: 350857
* [analyzer][NFC] Move CheckerRegistry from the Core directory to FrontendKristof Umann2018-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClangCheckerRegistry is a very non-obvious, poorly documented, weird concept. It derives from CheckerRegistry, and is placed in lib/StaticAnalyzer/Frontend, whereas it's base is located in lib/StaticAnalyzer/Core. It was, from what I can imagine, used to circumvent the problem that the registry functions of the checkers are located in the clangStaticAnalyzerCheckers library, but that library depends on clangStaticAnalyzerCore. However, clangStaticAnalyzerFrontend depends on both of those libraries. One can make the observation however, that CheckerRegistry has no place in Core, it isn't used there at all! The only place where it is used is Frontend, which is where it ultimately belongs. This move implies that since include/clang/StaticAnalyzer/Checkers/ClangCheckers.h only contained a single function: class CheckerRegistry; void registerBuiltinCheckers(CheckerRegistry &registry); it had to re purposed, as CheckerRegistry is no longer available to clangStaticAnalyzerCheckers. It was renamed to BuiltinCheckerRegistration.h, which actually describes it a lot better -- it does not contain the registration functions for checkers, but only those generated by the tblgen files. Differential Revision: https://reviews.llvm.org/D54436 llvm-svn: 349275
* [analyzer] Move out tracking retain count for OSObjects into a separate checkerGeorge Karpenkov2018-12-071-6/+8
| | | | | | | | | Allow enabling and disabling tracking of ObjC/CF objects separately from tracking of OS objects. Differential Revision: https://reviews.llvm.org/D55400 llvm-svn: 348638
* [analyzer] [NFC] Minor refactoring of RetainCountDiagnosticsGeorge Karpenkov2018-11-301-44/+3
| | | | | | | | | Move visitors to the implementation file, move a complicated logic into a function. Differential Revision: https://reviews.llvm.org/D55036 llvm-svn: 347946
* [analyzer][NFC] Fix some incorrect uses of -analyzer-config optionsKristof Umann2018-11-021-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | I'm in the process of refactoring AnalyzerOptions. The main motivation behind here is to emit warnings if an invalid -analyzer-config option is given from the command line, and be able to list them all. In this patch, I found some flags that should've been used as checker options, or have absolutely no mention of in AnalyzerOptions, or are nonexistent. - NonLocalizedStringChecker now uses its "AggressiveReport" flag as a checker option - lib/StaticAnalyzer/Frontend/ModelInjector.cpp now accesses the "model-path" option through a getter in AnalyzerOptions - -analyzer-config path-diagnostics-alternate=false is not a thing, I removed it, - lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp and lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h are weird, they actually only contain an option getter. I deleted them, and fixed RetainCountChecker to get it's "leak-diagnostics-reference-allocation" option as a checker option, - "region-store-small-struct-limit" has a proper getter now. Differential Revision: https://reviews.llvm.org/D53276 llvm-svn: 345985
* [analyzer] Enable retain count checking for OSObject by defaGeorge Karpenkov2018-10-311-1/+1
| | | | | | | | The FP rate seems to be good enough now. Differential Revision: https://reviews.llvm.org/D53849 llvm-svn: 345745
* Remove top-level using declaration from header files, as these aliases leak.Sam McCall2018-10-121-2/+0
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53135 llvm-svn: 344337
* [analyzer] Process state in checkEndFunction in RetainCountCheckerGeorge Karpenkov2018-09-211-4/+10
| | | | | | | | | | | | | | Modify the RetainCountChecker to perform state "adjustments" in checkEndFunction, as performing work in PreStmt<ReturnStmt> does not work with destructors. The previous version made an implicit assumption that no code runs after the return statement is executed. rdar://43945028 Differential Revision: https://reviews.llvm.org/D52338 llvm-svn: 342770
* [analyzer] Preliminary version of retain count checking for OSObjectsGeorge Karpenkov2018-08-231-7/+16
| | | | | | | | Has quite a lot of false positives, disabled behind the flag. Differential Revision: https://reviews.llvm.org/D50880 llvm-svn: 340502
* [analyzer] [NFC] Fix minor formatting issues in RetainCountCheckerGeorge Karpenkov2018-08-221-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D51072 llvm-svn: 340378
* [analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker - try #2George Karpenkov2018-08-211-4/+2
| | | | | | | | | | Turns out it can't be removed from the analyzer since it relies on CallEvent. Moving to staticAnalyzer/core Differential Revision: https://reviews.llvm.org/D51023 llvm-svn: 340247
* Revert "[analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker"Bruno Cardoso Lopes2018-08-181-2/+4
| | | | | | | | | | | | | | This reverts commit a786521fa66c72edd308baff0c08961b6d964fb1. Bots haven't caught up yet, but broke modules build with: ../tools/clang/include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h:18:10: fatal error: cyclic dependency in module 'Clang_StaticAnalyzer_Core': Clang_StaticAnalyzer_Core -> Clang_Analysis -> Clang_StaticAnalyzer_Checkers -> Clang_StaticAnalyzer_Core ^ llvm-svn: 340117
* [analyzer] [NFC] Split up RetainSummaryManager from RetainCountCheckerGeorge Karpenkov2018-08-181-4/+2
| | | | | | | | | | | | | ARCMigrator is using code from RetainCountChecker, which is a layering violation (and it also does it badly, by using a different header, and then relying on implementation being present in a header file). This change splits up RetainSummaryManager into a separate library in lib/Analysis, which can be used independently of a checker. Differential Revision: https://reviews.llvm.org/D50934 llvm-svn: 340114
* [analyzer] [NFC] Move ObjCRetainCount to include/AnalysisGeorge Karpenkov2018-08-171-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D50869 llvm-svn: 340096
* [analyzer] [NFC] Split up RetainCountCheckerGeorge Karpenkov2018-08-171-0/+446
At some point, staring at 4k+ LOC file becomes a bit hard. Differential Revision: https://reviews.llvm.org/D50821 llvm-svn: 340092
OpenPOWER on IntegriCloud