[PATCH] D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker

Malhar Thakkar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 01:26:22 PDT 2017


malhar1995 created this revision.
malhar1995 added a project: clang.

As part of my Google Summer of Code project, I am working on adding support for Integer Set Library (ISL) annotations to the current RetainCountChecker.

Note about ISL:
ISL has annotations __isl_give and __isl_take which are analogous to cf_returns_retained and cf_consumed but in case of ISL, annotations precede datatypes of function parameters.

So far, to build the ISL codebase using scan-build, I was #define-ing __isl_give and __isl_take to __attribute__((cf_returns_retained)) and __attribute__((cf_consumed)) respectively which resulted in the analyzer treating ISL objects as Core Foundation objects while performing reference counting.

This patch aims to add support for generic annotations (__attribute__(annotate("give"))) and __attribute__(annotate("take")))) in RetainCountChecker hence enabling the RetainCountChecker to perform reference counting for any codebase written in C.

Let me know your comments on the same.


Repository:
  rL LLVM

https://reviews.llvm.org/D35613

Files:
  include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
  lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
  test/Analysis/retain-release-inline.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35613.107259.patch
Type: text/x-patch
Size: 5363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170719/cddb81b1/attachment-0001.bin>


More information about the cfe-commits mailing list