aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-10 20:08:27 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-10 20:08:27 +0000
commitf40f0d5a382395e0301d7dcbeaa2b8e90b8973b1 (patch)
tree5c678db5df624ab214de033f24233b62e50d2d80 /lib/Rewrite/RewriteObjC.cpp
parent5e362102f8bac7a46cf8ff4394ea29548a4c1ab0 (diff)
Keep the source location of the selector in ObjCMessageExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index d689f22f68..0d3881197b 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -1228,10 +1228,12 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitSetter(BinaryOperator *BinOp, Expr *
bool Super = false;
QualType SuperTy;
SourceLocation SuperLocation;
+ SourceLocation SelectorLoc;
// Synthesize a ObjCMessageExpr from a ObjCPropertyRefExpr or ObjCImplicitSetterGetterRefExpr.
// This allows us to reuse all the fun and games in SynthMessageExpr().
if (ObjCPropertyRefExpr *PropRefExpr =
dyn_cast<ObjCPropertyRefExpr>(BinOp->getLHS())) {
+ SelectorLoc = PropRefExpr->getLocation();
if (PropRefExpr->isExplicitProperty()) {
ObjCPropertyDecl *PDecl = PropRefExpr->getExplicitProperty();
OMD = PDecl->getSetterMethodDecl();
@@ -1264,7 +1266,7 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitSetter(BinaryOperator *BinOp, Expr *
SuperLocation,
/*IsInstanceSuper=*/true,
SuperTy,
- Sel, OMD,
+ Sel, SelectorLoc, OMD,
&ExprVec[0], 1,
/*FIXME:*/SourceLocation());
else {
@@ -1281,7 +1283,7 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitSetter(BinaryOperator *BinOp, Expr *
Expr::getValueKindForType(Ty),
/*FIXME: */SourceLocation(),
cast<Expr>(Receiver),
- Sel, OMD,
+ Sel, SelectorLoc, OMD,
&ExprVec[0], 1,
/*FIXME:*/SourceLocation());
}
@@ -1306,8 +1308,10 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitGetter(Expr *PropOrGetterRefExpr) {
bool Super = false;
QualType SuperTy;
SourceLocation SuperLocation;
+ SourceLocation SelectorLoc;
if (ObjCPropertyRefExpr *PropRefExpr =
dyn_cast<ObjCPropertyRefExpr>(PropOrGetterRefExpr)) {
+ SelectorLoc = PropRefExpr->getLocation();
if (PropRefExpr->isExplicitProperty()) {
ObjCPropertyDecl *PDecl = PropRefExpr->getExplicitProperty();
OMD = PDecl->getGetterMethodDecl();
@@ -1338,7 +1342,7 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitGetter(Expr *PropOrGetterRefExpr) {
SuperLocation,
/*IsInstanceSuper=*/true,
SuperTy,
- Sel, OMD,
+ Sel, SelectorLoc, OMD,
0, 0,
/*FIXME:*/SourceLocation());
else {
@@ -1352,7 +1356,7 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitGetter(Expr *PropOrGetterRefExpr) {
Expr::getValueKindForType(Ty),
/*FIXME:*/SourceLocation(),
cast<Expr>(Receiver),
- Sel, OMD,
+ Sel, SelectorLoc, OMD,
0, 0,
/*FIXME:*/SourceLocation());
}