aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-09-13 17:29:07 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-09-13 17:29:07 +0000
commitca5c4c9bfeb4b1ac645b04723c0319b0fc96073e (patch)
tree852193cc2597c2a765eaf065b57f5ecd379d434c /lib/Sema/SemaDeclObjC.cpp
parent67330f197270d857e79d5da8309b9348f80da38d (diff)
Move no explicit ownership warning to SemaType.cpp.
// rdar://12280826 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 2dc2b0cba1..e80cc82482 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -282,28 +282,6 @@ void Sema::AddAnyMethodToGlobalPool(Decl *D) {
AddFactoryMethodToGlobalPool(MDecl, true);
}
-/// HasExplicitOwnershipAttr - returns true when pointer to ObjC pointer
-/// has explicit ownership attribute; false otherwise.
-static bool
-HasExplicitOwnershipAttr(Sema &S, ParmVarDecl *Param) {
- QualType T = Param->getType();
- if (!T->isObjCIndirectLifetimeType())
- return true;
- if (!T->isPointerType() && !T->isReferenceType())
- return true;
- T = T->isPointerType()
- ? T->getAs<PointerType>()->getPointeeType()
- : T->getAs<ReferenceType>()->getPointeeType();
- if (T->isObjCLifetimeType()) {
- // when lifetime is Qualifiers::OCL_None it means that it has
- // no implicit ownership qualifier (which means it is explicit).
- Qualifiers::ObjCLifetime lifetime =
- T.getLocalQualifiers().getObjCLifetime();
- return lifetime == Qualifiers::OCL_None;
- }
- return true;
-}
-
/// ActOnStartOfObjCMethodDef - This routine sets up parameters; invisible
/// and user declared, in the method definition's AST.
void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) {
@@ -335,11 +313,6 @@ void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) {
RequireCompleteType(Param->getLocation(), Param->getType(),
diag::err_typecheck_decl_incomplete_type))
Param->setInvalidDecl();
- if (!Param->isInvalidDecl() &&
- getLangOpts().ObjCAutoRefCount &&
- !HasExplicitOwnershipAttr(*this, Param))
- Diag(Param->getLocation(), diag::warn_arc_strong_pointer_objc_pointer) <<
- Param->getType();
if ((*PI)->getIdentifier())
PushOnScopeChains(*PI, FnBodyScope);