summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 3397680ee11..2a9abd4b384 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5107,25 +5107,6 @@ ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
OK));
}
-/// ConvertObjCSelfToClassRootType - convet type of 'self' in class method
-/// to pointer to root of method's class.
-static QualType
-ConvertObjCSelfToClassRootType(Sema &S, Expr *selfExpr) {
- QualType SelfType;
- if (const ObjCMethodDecl *MD = S.GetMethodIfSelfExpr(selfExpr))
- if (MD->isClassMethod()) {
- const ObjCInterfaceDecl *Root = 0;
- if (const ObjCInterfaceDecl * IDecl = MD->getClassInterface())
- do {
- Root = IDecl;
- } while ((IDecl = IDecl->getSuperClass()));
- if (Root)
- SelfType = S.Context.getObjCObjectPointerType(
- S.Context.getObjCInterfaceType(Root));
- }
- return SelfType;
-}
-
// checkPointerTypesForAssignment - This is a very tricky routine (despite
// being closely modeled after the C99 spec:-). The odd characteristic of this
// routine is it effectively iqnores the qualifiers on the top level pointee.
@@ -5453,7 +5434,7 @@ Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS,
Kind = CK_BitCast;
return Compatible;
}
-
+
Kind = CK_BitCast;
return IncompatiblePointer;
}
@@ -5501,9 +5482,6 @@ Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS,
// Conversions to Objective-C pointers.
if (isa<ObjCObjectPointerType>(LHSType)) {
- QualType RHSQT = ConvertObjCSelfToClassRootType(*this, RHS.get());
- if (!RHSQT.isNull())
- RHSType = RHSQT;
// A* -> B*
if (RHSType->isObjCObjectPointerType()) {
Kind = CK_BitCast;
@@ -9619,7 +9597,7 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) {
Selector Sel = ME->getSelector();
// self = [<foo> init...]
- if (GetMethodIfSelfExpr(Op->getLHS()) && Sel.getNameForSlot(0).startswith("init"))
+ if (isSelfExpr(Op->getLHS()) && Sel.getNameForSlot(0).startswith("init"))
diagnostic = diag::warn_condition_is_idiomatic_assignment;
// <foo> = [<bar> nextObject]
OpenPOWER on IntegriCloud