[PATCH] D113530: [wip] [analyzer] support use-after-free checking with parameter annotation

2021-12-22 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo updated this revision to Diff 395926. chrisdangelo added a comment. "I think it makes sense to simply copy that file and replace function attributes with parameter attributes and see if it still passes." - @NoQ (Tue, Dec 21, 12:28 PM) Sounds good. This newest change adds malloc-ann

[PATCH] D113530: [wip] [analyzer] support use-after-free checking with parameter annotation

2021-12-21 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1405 -void MallocChecker::checkOwnershipAttr(const CallEvent &Call, - CheckerContext &C) const { +static const FunctionDecl *functionDeclFor

[PATCH] D113530: [wip] [analyzer] support use-after-free checking with parameter annotation

2021-12-21 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo updated this revision to Diff 395734. chrisdangelo added a comment. This change includes clang-format edits. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113530/new/ https://reviews.llvm.org/D113530 Files: clang/include/clang/Basic/Attr.td clang/lib/Sema/SemaDeclAttr.

[PATCH] D113530: [wip] [analyzer] support use-after-free checking with parameter annotation

2021-12-21 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo updated this revision to Diff 395726. chrisdangelo edited the summary of this revision. chrisdangelo added a comment. This change removes the previous ownership_takes_param work. This change augments the existing Ownership attribute so that it is now applicable to function parameter

[PATCH] D113622: [wip] [analyzer] support ignoring use-after-free checking with reference_counted attribute

2021-12-14 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo added a comment. Hi @aaron.ballman, It's nice to meet you, virtually. I've been working with @NoQ on this change. I've now removed the [wip] prefix. When you have some time, I'd appreciate your feedback. This change adds a new attribute "reference_counted". This attribute is inte

[PATCH] D113622: [wip] [analyzer] support ignoring use-after-free checking with reference_counted attribute

2021-12-14 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo updated this revision to Diff 394374. chrisdangelo added a comment. Herald added a subscriber: jdoerfert. This change adds support for reference_counted attribute in pragma-attribute-supported-attributes-list. This change edits comments describing function signatures for isReferenc

[PATCH] D113622: [wip] [analyzer] support ignoring use-after-free checking with reference_counted attribute

2021-12-13 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo updated this revision to Diff 394017. chrisdangelo added a comment. These changes allow the analyzer to silence an issue discovered by MallocChecker if the SymRef or Statement in question is of a struct that has been declared with the compiler attribute annotation "reference_counted

[PATCH] D113622: [wip] [analyzer] support ignoring use-after-free checking with reference_counted attribute

2021-12-01 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1735 + let Spellings = [Clang<"reference_counted">]; + let Subjects = SubjectList<[Record]>; + let Documentation = [Undocumented]; I've discussed a bit with Devin Coughlin yester

[PATCH] D113530: [wip] [analyzer] support use-after-free checking with parameter annotation

2021-11-15 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo added inline comments. Comment at: clang/include/clang/Basic/Attr.td:2383 +def OwnershipParam : InheritableParamAttr { + let Spellings = [Clang<"ownership_takes_param">]; + let Subjects = SubjectList<[ParmVar]>; I've discussed this a bit with Artem

[PATCH] D111655: [analyzer] non-obvious analyzer warning: Use of zero-allocated memory

2021-10-12 Thread Chris D'Angelo via Phabricator via cfe-commits
chrisdangelo created this revision. chrisdangelo added a reviewer: NoQ. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. chrisdangelo requested review of this revision. Herald added