diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-11 20:58:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-11 20:58:55 +0000 |
commit | 01a4cf11777bb34c35f5d251a9e95eb736d0842b (patch) | |
tree | a42cce429ab7bfe7f553876d4249d4a4cf7072aa /lib/Sema/SemaExpr.cpp | |
parent | 0aeb2890389ec1872e49a18fb2022bfb9f96578d (diff) |
Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 1f0e518afe..d78c4962a4 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4728,34 +4728,34 @@ QualType Sema::FindCompositeObjCPointerType(ExprResult &LHS, ExprResult &RHS, // to the pseudo-builtin, because that will be implicitly cast back to the // redefinition type if an attempt is made to access its fields. if (LHSTy->isObjCClassType() && - (Context.hasSameType(RHSTy, Context.ObjCClassRedefinitionType))) { + (Context.hasSameType(RHSTy, Context.getObjCClassRedefinitionType()))) { RHS = ImpCastExprToType(RHS.take(), LHSTy, CK_BitCast); return LHSTy; } if (RHSTy->isObjCClassType() && - (Context.hasSameType(LHSTy, Context.ObjCClassRedefinitionType))) { + (Context.hasSameType(LHSTy, Context.getObjCClassRedefinitionType()))) { LHS = ImpCastExprToType(LHS.take(), RHSTy, CK_BitCast); return RHSTy; } // And the same for struct objc_object* / id if (LHSTy->isObjCIdType() && - (Context.hasSameType(RHSTy, Context.ObjCIdRedefinitionType))) { + (Context.hasSameType(RHSTy, Context.getObjCIdRedefinitionType()))) { RHS = ImpCastExprToType(RHS.take(), LHSTy, CK_BitCast); return LHSTy; } if (RHSTy->isObjCIdType() && - (Context.hasSameType(LHSTy, Context.ObjCIdRedefinitionType))) { + (Context.hasSameType(LHSTy, Context.getObjCIdRedefinitionType()))) { LHS = ImpCastExprToType(LHS.take(), RHSTy, CK_BitCast); return RHSTy; } // And the same for struct objc_selector* / SEL if (Context.isObjCSelType(LHSTy) && - (Context.hasSameType(RHSTy, Context.ObjCSelRedefinitionType))) { + (Context.hasSameType(RHSTy, Context.getObjCSelRedefinitionType()))) { RHS = ImpCastExprToType(RHS.take(), LHSTy, CK_BitCast); return LHSTy; } if (Context.isObjCSelType(RHSTy) && - (Context.hasSameType(LHSTy, Context.ObjCSelRedefinitionType))) { + (Context.hasSameType(LHSTy, Context.getObjCSelRedefinitionType()))) { LHS = ImpCastExprToType(LHS.take(), RHSTy, CK_BitCast); return RHSTy; } @@ -5340,7 +5340,8 @@ Sema::CheckAssignmentConstraints(QualType lhsType, ExprResult &rhs, // - conversions from 'Class' to the redefinition type if (rhsType->isObjCClassType() && - Context.hasSameType(lhsType, Context.ObjCClassRedefinitionType)) { + Context.hasSameType(lhsType, + Context.getObjCClassRedefinitionType())) { Kind = CK_BitCast; return Compatible; } @@ -5421,7 +5422,8 @@ Sema::CheckAssignmentConstraints(QualType lhsType, ExprResult &rhs, // - conversions to 'Class' from its redefinition type if (lhsType->isObjCClassType() && - Context.hasSameType(rhsType, Context.ObjCClassRedefinitionType)) { + Context.hasSameType(rhsType, + Context.getObjCClassRedefinitionType())) { Kind = CK_BitCast; return Compatible; } |