[PATCH] D31177: [ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer and objective-c object pointer
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 23 05:06:04 PDT 2017
arphaman added inline comments.
================
Comment at: lib/Sema/SemaExpr.cpp:9431
+ ? 2
+ : 1)) {
if (convertPointersToCompositeType(*this, Loc, LHS, RHS))
----------------
ahatanak wrote:
> It wasn't clear to me why the code has to be added to the right hand side of the >= operator.
>
> Is it equivalent to adding the following code, which I think is easier to understand? I'm assuming you are trying to avoid executing the statement when ObjCAutoRefCount is true and either LHSType or RHSType is an objc pointer type.
>
> ```
> && (!LangOpts.ObjCAutoRefCount || (!LHSType->isObjCObjectPointerType() && !RHSType->isObjCObjectPointerType()))
> ```
Yes, that's correct. I think a more clear condition would be better here, I agree.
Repository:
rL LLVM
https://reviews.llvm.org/D31177
More information about the cfe-commits
mailing list