summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-09-15 20:40:18 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-09-15 20:40:18 +0000
commitd923eb0d1e358b07b4f5c0709d7171ba56d15881 (patch)
treeb24331a7c91fd7b67fe4e213ad7ae212c00b257e /clang/lib
parentdff0e892db7c39ec39c61317bba368532f643077 (diff)
downloadbcm5719-llvm-d923eb0d1e358b07b4f5c0709d7171ba56d15881.tar.gz
bcm5719-llvm-d923eb0d1e358b07b4f5c0709d7171ba56d15881.zip
reverse patch in r139818 to focus on 'self'
instead of 'Class'. llvm-svn: 139834
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 35b38b101a3..16b55f1aee4 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5227,35 +5227,6 @@ checkBlockPointerTypesForAssignment(Sema &S, QualType LHSType,
return ConvTy;
}
-static Sema::AssignConvertType
-checkObjCPointerTypesForAssignment(Sema &S, QualType LHSType,
- QualType RHSType);
-/// checkClassTypes - Routine checks for conversion of "Class" type.
-// Conversion from type Class to any root class type in a class method
-// is allowed.
-static Sema::AssignConvertType
-checkClassTypes(Sema &S, QualType LHSType) {
- // Conversion from type Class to any root class type is allowed.
- DeclContext *DC = S.CurContext;
- while (isa<BlockDecl>(DC))
- DC = DC->getParent();
- ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(DC);
- if (MD && MD->isClassMethod()) {
- ObjCInterfaceDecl *Root = 0;
- if (ObjCInterfaceDecl * IDecl = MD->getClassInterface())
- do
- Root = IDecl;
- while ((IDecl = IDecl->getSuperClass()));
- if (Root){
- QualType RHSType =
- S.Context.getObjCObjectPointerType(
- S.Context.getObjCInterfaceType(Root));
- return checkObjCPointerTypesForAssignment(S, LHSType, RHSType);
- }
- }
- return Sema::IncompatiblePointer;
-}
-
/// checkObjCPointerTypesForAssignment - Compares two objective-c pointer types
/// for assignment compatibility.
static Sema::AssignConvertType
@@ -5274,7 +5245,7 @@ checkObjCPointerTypesForAssignment(Sema &S, QualType LHSType,
if (RHSType->isObjCBuiltinType()) {
if (RHSType->isObjCClassType() && !LHSType->isObjCBuiltinType() &&
!LHSType->isObjCQualifiedClassType())
- return checkClassTypes(S, LHSType);
+ return Sema::IncompatiblePointer;
return Sema::Compatible;
}
QualType lhptee = LHSType->getAs<ObjCObjectPointerType>()->getPointeeType();
OpenPOWER on IntegriCloud