diff options
| author | Douglas Gregor <dgregor@apple.com> | 2015-06-19 23:17:46 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2015-06-19 23:17:46 +0000 |
| commit | eb6e64ca8fd72725153fc25914f94a771d9c8572 (patch) | |
| tree | d2722fd8b182c767f33ef4e5dfd4b4b1db8c6a40 /clang/lib/Analysis | |
| parent | 74ecc89c464a858f261ec279dd202dfafa476d7d (diff) | |
| download | bcm5719-llvm-eb6e64ca8fd72725153fc25914f94a771d9c8572.tar.gz bcm5719-llvm-eb6e64ca8fd72725153fc25914f94a771d9c8572.zip | |
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
llvm-svn: 240185
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/CocoaConventions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CocoaConventions.cpp b/clang/lib/Analysis/CocoaConventions.cpp index 0db3cac58b5..be1262dc991 100644 --- a/clang/lib/Analysis/CocoaConventions.cpp +++ b/clang/lib/Analysis/CocoaConventions.cpp @@ -25,7 +25,7 @@ using namespace ento; bool cocoa::isRefType(QualType RetTy, StringRef Prefix, StringRef Name) { // Recursively walk the typedef stack, allowing typedefs of reference types. - while (const TypedefType *TD = dyn_cast<TypedefType>(RetTy.getTypePtr())) { + while (const TypedefType *TD = RetTy->getAs<TypedefType>()) { StringRef TDName = TD->getDecl()->getIdentifier()->getName(); if (TDName.startswith(Prefix) && TDName.endswith("Ref")) return true; |

