Allow the cf_returns_[not_]retained attributes to appear on out-parameters.
Includes a simple static analyzer check and not much else, but we'll also be able to take advantage of this in Swift. This feature can be tested for using __has_feature(cf_returns_on_parameters). This commit also contains two fixes: - Look through non-typedef sugar when deciding whether something is a CF type. - When (cf|ns)_returns(_not)?_retained is applied to invalid properties, refer to "property" instead of "method" in the error message. rdar://problem/18742441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240185 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticSemaKinds.td 2 additions, 2 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h 8 additions, 0 deletionsinclude/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
- lib/Analysis/CocoaConventions.cpp 1 addition, 1 deletionlib/Analysis/CocoaConventions.cpp
- lib/Lex/PPMacroExpansion.cpp 1 addition, 0 deletionslib/Lex/PPMacroExpansion.cpp
- lib/Sema/SemaDeclAttr.cpp 43 additions, 5 deletionslib/Sema/SemaDeclAttr.cpp
- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp 69 additions, 5 deletionslib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
- test/Analysis/retain-release.m 27 additions, 0 deletionstest/Analysis/retain-release.m
- test/SemaObjC/attr-cf_returns.m 49 additions, 0 deletionstest/SemaObjC/attr-cf_returns.m
Loading
Please register or sign in to comment