diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-12 02:34:39 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-12 02:34:39 +0000 |
commit | 746f5bcbfde5b25269169c63c66492311673b67d (patch) | |
tree | ec07bd23c545817958c8b8340f40fdbcd1acf96e /lib/Sema/SemaPseudoObject.cpp | |
parent | d8b4216c82d6ab1f8f2fb49c052aaea263027d7b (diff) |
Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.
This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148013 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaPseudoObject.cpp')
-rw-r--r-- | lib/Sema/SemaPseudoObject.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index 08b3fc82ca..fa56b258da 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -492,11 +492,9 @@ ExprResult ObjCPropertyOpBuilder::buildGet() { assert(Getter); QualType receiverType; - SourceLocation superLoc; if (RefExpr->isClassReceiver()) { receiverType = S.Context.getObjCInterfaceType(RefExpr->getClassReceiver()); } else if (RefExpr->isSuperReceiver()) { - superLoc = RefExpr->getReceiverLocation(); receiverType = RefExpr->getSuperReceiverType(); } else { assert(InstanceReceiver); @@ -507,19 +505,14 @@ ExprResult ObjCPropertyOpBuilder::buildGet() { ExprResult msg; if (Getter->isInstanceMethod() || RefExpr->isObjectReceiver()) { assert(InstanceReceiver || RefExpr->isSuperReceiver()); - msg = S.BuildInstanceMessage(InstanceReceiver, receiverType, superLoc, - Getter->getSelector(), Getter, - GenericLoc, GenericLoc, GenericLoc, - MultiExprArg()); + msg = S.BuildInstanceMessageImplicit(InstanceReceiver, receiverType, + GenericLoc, Getter->getSelector(), + Getter, MultiExprArg()); } else { - TypeSourceInfo *receiverTypeInfo = 0; - if (!RefExpr->isSuperReceiver()) - receiverTypeInfo = S.Context.getTrivialTypeSourceInfo(receiverType); - - msg = S.BuildClassMessage(receiverTypeInfo, receiverType, superLoc, - Getter->getSelector(), Getter, - GenericLoc, GenericLoc, GenericLoc, - MultiExprArg()); + msg = S.BuildClassMessageImplicit(receiverType, RefExpr->isSuperReceiver(), + GenericLoc, + Getter->getSelector(), Getter, + MultiExprArg()); } return msg; } @@ -534,11 +527,9 @@ ExprResult ObjCPropertyOpBuilder::buildSet(Expr *op, SourceLocation opcLoc, assert(hasSetter); (void) hasSetter; QualType receiverType; - SourceLocation superLoc; if (RefExpr->isClassReceiver()) { receiverType = S.Context.getObjCInterfaceType(RefExpr->getClassReceiver()); } else if (RefExpr->isSuperReceiver()) { - superLoc = RefExpr->getReceiverLocation(); receiverType = RefExpr->getSuperReceiverType(); } else { assert(InstanceReceiver); @@ -570,19 +561,14 @@ ExprResult ObjCPropertyOpBuilder::buildSet(Expr *op, SourceLocation opcLoc, // Build a message-send. ExprResult msg; if (Setter->isInstanceMethod() || RefExpr->isObjectReceiver()) { - msg = S.BuildInstanceMessage(InstanceReceiver, receiverType, superLoc, - SetterSelector, Setter, - GenericLoc, GenericLoc, GenericLoc, - MultiExprArg(args, 1)); + msg = S.BuildInstanceMessageImplicit(InstanceReceiver, receiverType, + GenericLoc, SetterSelector, Setter, + MultiExprArg(args, 1)); } else { - TypeSourceInfo *receiverTypeInfo = 0; - if (!RefExpr->isSuperReceiver()) - receiverTypeInfo = S.Context.getTrivialTypeSourceInfo(receiverType); - - msg = S.BuildClassMessage(receiverTypeInfo, receiverType, superLoc, - SetterSelector, Setter, - GenericLoc, GenericLoc, GenericLoc, - MultiExprArg(args, 1)); + msg = S.BuildClassMessageImplicit(receiverType, RefExpr->isSuperReceiver(), + GenericLoc, + SetterSelector, Setter, + MultiExprArg(args, 1)); } if (!msg.isInvalid() && captureSetValueAsResult) { |