summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/Inputs/expected-plists
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix Objective-C accessor body farms after 2073dd2d.Artem Dergachev2019-11-211-23/+59
| | | | | | | | | | Fix a canonicalization problem for the newly added property accessor stubs that was causing a wrong decl to be used for 'self' in the accessor's body farm. Fix a crash when constructing a body farm for accessors of a property that is declared and @synthesize'd in different (but related) interfaces. Differential Revision: https://reviews.llvm.org/D70158
* Redeclare Objective-C property accessors inside the ObjCImplDecl in which ↵Adrian Prantl2019-11-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are synthesized. This patch is motivated by (and factored out from) https://reviews.llvm.org/D66121 which is a debug info bugfix. Starting with DWARF 5 all Objective-C methods are nested inside their containing type, and that patch implements this for synthesized Objective-C properties. 1. SemaObjCProperty populates a list of synthesized accessors that may need to inserted into an ObjCImplDecl. 2. SemaDeclObjC::ActOnEnd inserts forward-declarations for all accessors for which no override was provided into their ObjCImplDecl. This patch does *not* synthesize AST function *bodies*. Moving that code from the static analyzer into Sema may be a good idea though. 3. Places that expect all methods to have bodies have been updated. I did not update the static analyzer's inliner for synthesized properties to point back to the property declaration (see test/Analysis/Inputs/expected-plists/nullability-notes.m.plist), which I believed to be more bug than a feature. Differential Revision: https://reviews.llvm.org/D68108 rdar://problem/53782400
* [analyzer] NonNullParamChecker and CStringChecker parameter number in ↵Kristof Umann2019-09-032-6/+6
| | | | | | | | | | | | | | | | | | | | checker message There are some functions which can't be given a null pointer as parameter either because it has a nonnull attribute or it is declared to have undefined behavior (e.g. strcmp()). Sometimes it is hard to determine from the checker message which parameter is null at the invocation, so now this information is included in the message. This commit fixes https://bugs.llvm.org/show_bug.cgi?id=39358 Reviewed By: NoQ, Szelethus, whisperity Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D66333 llvm-svn: 370798
* [analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPiecesCsaba Dabis2019-08-095-80/+99
| | | | | | | | | | | | | | | | Summary: A condition could be a multi-line expression where we create the highlight in separated chunks. PathDiagnosticPopUpPiece is not made for that purpose, it cannot be added to multiple lines because we have only one ending part which contains all the notes. So that it cannot have multiple endings and therefore this patch narrows down the ranges of the highlight to the given interesting variable of the condition. It prevents HTML-breaking injections. Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D65663 llvm-svn: 368382
* [analyzer][NFC][tests] Pre-normalize expected-plistsHubert Tong2019-06-0817-32/+0
| | | | | | | | As suggested in the review for D62949, this patch pre-normalizes the reference expected output plist files by removing lines containing fields for which we expect differences that should be ignored. llvm-svn: 362877
* [analyzer][NFC][tests] Remove unused expected-plist filesHubert Tong2019-06-083-21/+0
| | | | llvm-svn: 362876
* [analyzer] ConditionBRVisitor: Boolean supportCsaba Dabis2019-05-291-2/+2
| | | | | | | | | | | | | | | | | Summary: - Reviewers: NoQ, george.karpenkov Reviewed By: NoQ, george.karpenkov Subscribers: cfe-commits, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp Tags: #clang Differential Revision: https://reviews.llvm.org/D58207 llvm-svn: 362027
* [analyzer] ConditionBRVisitor: MemberExpr supportCsaba Dabis2019-05-291-0/+62
| | | | | | | | | | | | | | | | | Summary: - Reviewers: NoQ, george.karpenkov Reviewed By: NoQ Subscribers: cfe-commits, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp Tags: #clang Differential Revision: https://reviews.llvm.org/D58206 llvm-svn: 362026
* [analyzer] ConditionBRVisitor: Test 'add-pop-up-notes=false'Csaba Dabis2019-05-291-126/+98
| | | | | | | | | | | | | | | | | Summary: - Reviewers: NoQ, alexfh Reviewed By: alexfh Subscribers: cfe-commits, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp Tags: #clang Differential Revision: https://reviews.llvm.org/D61060 llvm-svn: 362023
* [analyzer] ConditionBRVisitor: Enhance to write out more informationCsaba Dabis2019-05-2910-154/+1991
| | | | | | | | | | | | | | | | | | | | Summary: Add extra messages to the bug report to inform the user why the analyzer `Taking true/false branch`. Reviewers: NoQ, george.karpenkov Reviewed By: NoQ Subscribers: gerazo, gsd, dkrupp, whisperity, baloghadamsoftware, xazax.hun, eraman, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D53076 llvm-svn: 362020
* [analyzer][tests][NFC] Add EOF newlines, normalize reference expected filesHubert Tong2019-05-013-2/+3
| | | | | | | | | | | Reference expected files not ending with a newline are normalized to have said newlines. Additionally `plist-macros-with-expansion.cpp.plist` is modified to add a line that is ignored by `%diff_plist`, but not by the more sensitive pattern proposed by http://lists.llvm.org/pipermail/cfe-dev/2019-April/061904.html for `%normalize_plist`. llvm-svn: 359692
* [analyzer] Fix function macro crashKristof Umann2019-03-141-0/+478
| | | | | | | | Re-commit D57893. Differential Revision: https://reviews.llvm.org/D57893 llvm-svn: 356142
* Revert "[analyzer] Fix function macro crash"Kristof Umann2019-03-121-478/+0
| | | | | | | | | Buildbot breaks when LLVm is compiled with memory sanitizer. WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xa3d16d8 in getMacroNameAndPrintExpansion(blahblah) lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:903:11 llvm-svn: 355911
* [analyzer] Fix function macro crashKristof Umann2019-03-121-0/+478
| | | | | | | | | | | | | | | | | | | When there is a functor-like macro which is passed as parameter to another "function" macro then its parameters are not listed at the place of expansion: #define foo(x) int bar() { return x; } #define hello(fvar) fvar(0) hello(foo) int main() { 1 / bar(); } Expansion of hello(foo) asserted Clang, because it expected an l_paren token in the 3rd line after "foo", since it is a function-like token. Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D57893 llvm-svn: 355903
* [analyzer] Fix infinite recursion in printing macrosKristof Umann2019-03-081-0/+134
| | | | | | | | | | | | | | | | | | | | In the commited testfile, macro expansion (the one implemented for the plist output) runs into an infinite recursion. The issue originates from the algorithm being faulty, as in #define value REC_MACRO_FUNC(value) the "value" is being (or at least attempted) expanded from the same macro. The solved this issue by gathering already visited macros in a set, which does resolve the crash, but will result in an incorrect macro expansion, that would preferably be fixed down the line. Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D57891 llvm-svn: 355705
* [analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of ↵George Karpenkov2019-01-302-4306/+4310
| | | | | | | | Objective-C methods Differential Revision: https://reviews.llvm.org/D57433 llvm-svn: 352588
* [analyzer] [RetainCountChecker] Track input parameters to the top-level functionGeorge Karpenkov2019-01-292-6452/+6452
| | | | | | | | | | 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] Reimplement dependencies between checkersKristof Umann2019-01-269-516/+500
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, up until now, the fact that certain checkers depended on one another was known, but how these actually unfolded was hidden deep within the implementation. For example, many checkers (like RetainCount, Malloc or CString) modelled a certain functionality, and exposed certain reportable bug types to the user. For example, while MallocChecker models many many different types of memory handling, the actual "unix.MallocChecker" checker the user was exposed to was merely and option to this modeling part. Other than this being an ugly mess, this issue made resolving the checker naming issue almost impossible. (The checker naming issue being that if a checker registered more than one checker within its registry function, both checker object recieved the same name) Also, if the user explicitly disabled a checker that was a dependency of another that _was_ explicitly enabled, it implicitly, without "telling" the user, reenabled it. Clearly, changing this to a well structured, declarative form, where the handling of dependencies are done on a higher level is very much preferred. This patch, among the detailed things later, makes checkers declare their dependencies within the TableGen file Checkers.td, and exposes the same functionality to plugins and statically linked non-generated checkers through CheckerRegistry::addDependency. CheckerRegistry now resolves these dependencies, makes sure that checkers are added to CheckerManager in the correct order, and makes sure that if a dependency is disabled, so will be every checker that depends on it. In detail: * Add a new field to the Checker class in CheckerBase.td called Dependencies, which is a list of Checkers. * Move unix checkers before cplusplus, as there is no forward declaration in tblgen :/ * Add the following new checkers: - StackAddrEscapeBase - StackAddrEscapeBase - CStringModeling - DynamicMemoryModeling (base of the MallocChecker family) - IteratorModeling (base of the IteratorChecker family) - ValistBase - SecuritySyntaxChecker (base of bcmp, bcopy, etc...) - NSOrCFErrorDerefChecker (base of NSErrorChecker and CFErrorChecker) - IvarInvalidationModeling (base of IvarInvalidation checker family) - RetainCountBase (base of RetainCount and OSObjectRetainCount) * Clear up and registry functions in MallocChecker, happily remove old FIXMEs. * Add a new addDependency function to CheckerRegistry. * Neatly format RUN lines in files I looked at while debugging. Big thanks to Artem Degrachev for all the guidance through this project! Differential Revision: https://reviews.llvm.org/D54438 llvm-svn: 352287
* [analyzer] Split unix.API up to UnixAPIMisuseChecker and ↵Kristof Umann2019-01-261-18/+18
| | | | | | | | | | | | | | | | UnixAPIPortabilityChecker The actual implementation of unix.API features a dual-checker: two checkers in one, even though they don't even interact at all. Split them up, as this is a problem for establishing dependencies. I added no new code at all, just merely moved it around. Since the plist files change (and that's a benefit!) this patch isn't NFC. Differential Revision: https://reviews.llvm.org/D55425 llvm-svn: 352278
* [analyzer] Support for OSObjects out parameters in RetainCountCheckerGeorge Karpenkov2019-01-112-8/+8
| | | | | | | | | rdar://46357478 rdar://47121327 Differential Revision: https://reviews.llvm.org/D56240 llvm-svn: 350982
* [analyzer] [NFC] Fix the FIXME in testsGeorge Karpenkov2019-01-112-0/+52295
| | | | llvm-svn: 350946
* [analyzer] Update the category name for RetainCountChecker reportsGeorge Karpenkov2019-01-106-40/+40
| | | | | | | | | | ..now that it includes OSObjects rdar://46509986 Differential Revision: https://reviews.llvm.org/D56404 llvm-svn: 350869
* [analyzer] Quote the type of the leaked/problematic object in diagnostics ↵George Karpenkov2019-01-105-1190/+1224
| | | | | | | | for readability Differential Revision: https://reviews.llvm.org/D56344 llvm-svn: 350867
* Revert rC349281 '[analyzer][MallocChecker][NFC] Document and reorganize some ↵Kristof Umann2018-12-171-10/+10
| | | | | | functions' llvm-svn: 349340
* [analyzer][MallocChecker] Improve warning messages on double-delete errorsKristof Umann2018-12-151-10/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D54834 llvm-svn: 349283
* [analyzer][PlistMacroExpansion] Part 5.: Support for # and ##Kristof Umann2018-11-301-64/+402
| | | | | | | | | From what I can see, this should be the last patch needed to replicate macro argument expansions. Differential Revision: https://reviews.llvm.org/D52988 llvm-svn: 348025
* [analyzer] Add the type of the leaked object to the diagnostic messageGeorge Karpenkov2018-11-302-6/+6
| | | | | | | | | | | | If the object is a temporary, and there is no variable it binds to, let's at least print out the object name in order to help differentiate it from other temporaries. rdar://45175098 Differential Revision: https://reviews.llvm.org/D55033 llvm-svn: 347943
* [analyzer] Reference leaked object by name, even if it was created in an ↵George Karpenkov2018-11-301-3/+3
| | | | | | | | | | inlined function. rdar://45532181 Differential Revision: https://reviews.llvm.org/D54973 llvm-svn: 347942
* [analyzer][PlistMacroExpansion] Part 4.: Support for __VA_ARGS__Kristof Umann2018-11-291-82/+251
| | | | | | Differential Revision: https://reviews.llvm.org/D52986 llvm-svn: 347888
* [analyzer][PlistMacroExpansion] Part 3.: Macro arguments are expandedKristof Umann2018-11-271-80/+3637
| | | | | | | | This part focuses on expanding macro arguments. Differential Revision: https://reviews.llvm.org/D52795 llvm-svn: 347629
* Reland '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name ↵Kristof Umann2018-11-051-5/+1042
| | | | | | and primitive expansion' llvm-svn: 346111
* Revert '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name ↵Kristof Umann2018-11-041-1042/+5
| | | | | | and primitive expansion' llvm-svn: 346096
* [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and ↵Kristof Umann2018-11-041-5/+1042
| | | | | | | | | | | primitive expansion This patch adds a couple new functions to acquire the macro's name, and also expands it, although it doesn't expand the arguments, as seen from the test files Differential Revision: https://reviews.llvm.org/D52794 llvm-svn: 346095
* [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flagKristof Umann2018-10-311-0/+351
| | | | | | | | | | | | | This is the first part of the implementation of the inclusion of macro expansions into the plist output. It adds a new flag that adds a new "macro_expansions" entry to each report that has PathDiagnosticPieces that were expanded from a macro. While there's an entry for each macro expansion, both the name of the macro and what it expands to is missing, and will be implemented in followup patches. Differential Revision: https://reviews.llvm.org/D52742 llvm-svn: 345724
* [cxx2a] P0614R1: Support init-statements in range-based for loops.Richard Smith2018-09-281-0/+281
| | | | | | | We don't yet support this for the case where a range-based for loop is implicitly rewritten to an ObjC for..in statement. llvm-svn: 343350
* [analyzer] Process state in checkEndFunction in RetainCountCheckerGeorge Karpenkov2018-09-211-247/+1
| | | | | | | | | | | | | | 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
* Revert "Revert "Revert "Revert "[analyzer] Add coverage information to plist ↵George Karpenkov2018-09-0719-2589/+10795
| | | | | | | | | | output, update tests"""" This reverts commit 2f5d71d9fa135be86bb299e7d773036e50bf1df6. Hopefully fixing tests on Windows. llvm-svn: 341719
* Revert "Revert "Revert "[analyzer] Add coverage information to plist output, ↵Simon Pilgrim2018-09-0719-10795/+2589
| | | | | | | | update tests""" Reverts analyzer tests from rL341627 again as they still broke windows buildbots llvm-svn: 341648
* Revert "Revert "[analyzer] Add coverage information to plist output, update ↵George Karpenkov2018-09-0719-2589/+10795
| | | | | | | | | | tests"" This reverts commit a39bcab414dd7ace7e490363ecdf01ecce7743fc. Reverting the revert, fixing tests. llvm-svn: 341627
* Revert "[analyzer] Add coverage information to plist output, update tests"George Karpenkov2018-09-0719-10704/+2668
| | | | | | | | This reverts commit 03d183b6b94eda27ce66a4f9b87a00b0a148cf9e. Temporary revert until the tests are fixed. llvm-svn: 341626
* [analyzer] Add coverage information to plist output, update testsGeorge Karpenkov2018-09-0719-2668/+10704
| | | | | | | | Split tests which were still using FileCheck to compare plists. Differential Revision: https://reviews.llvm.org/D51515 llvm-svn: 341621
* [analyzer] Re-instate support for MakeCollectable is RetainCountCheckerGeorge Karpenkov2018-08-171-517/+629
| | | | | | Differential Revision: https://reviews.llvm.org/D50872 llvm-svn: 340097
* [analyzer] Drop support for GC mode in RetainCountCheckerGeorge Karpenkov2018-08-172-1952/+518
| | | | | | | | | | | | A lot of code in RetainCountChecker deals with GC mode. Given that GC mode is deprecated, Apple does not ship runtime for it, and modern compiler toolchain does not support it, it makes sense to remove the code dealing with it in order to aid understanding of RetainCountChecker. Differential Revision: https://reviews.llvm.org/D50747 llvm-svn: 340091
* Move test inputs into Inputs directory.Richard Smith2018-08-1422-0/+56972
We don't need a new ExpectedOutputs/ convention. Expected outputs are just another form of test input. llvm-svn: 339634
OpenPOWER on IntegriCloud