[cfe-commits] r153708 - in /cfe/trunk: test/Index/get-cursor.m tools/libclang/CIndex.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Mar 29 17:19:13 PDT 2012
Author: akirtzidis
Date: Thu Mar 29 19:19:13 2012
New Revision: 153708
URL: http://llvm.org/viewvc/llvm-project?rev=153708&view=rev
Log:
[libclang] A MemberRefExpr cursor for a property dot syntax should have as
its location the location of the property.
Part of rdar://11113120
Modified:
cfe/trunk/test/Index/get-cursor.m
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/test/Index/get-cursor.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/get-cursor.m?rev=153708&r1=153707&r2=153708&view=diff
==============================================================================
--- cfe/trunk/test/Index/get-cursor.m (original)
+++ cfe/trunk/test/Index/get-cursor.m Thu Mar 29 19:19:13 2012
@@ -36,6 +36,8 @@
-(void)mm:(struct S*)s {
rdar10902015 *i = 0;
s->x = 0;
+ Test1 *test1;
+ test1.name = 0;
}
@end
@@ -54,3 +56,4 @@
// RUN: c-index-test -cursor-at=%s:38:6 -cursor-at=%s:40:11 %s | FileCheck -check-prefix=CHECK-MEMBERREF %s
// CHECK-MEMBERREF: 38:6 MemberRefExpr=x:34:16 SingleRefName=[38:6 - 38:7] RefName=[38:6 - 38:7] Extent=[38:3 - 38:7]
+// CHECK-MEMBERREF: 40:9 MemberRefExpr=name:23:21 Extent=[40:3 - 40:13] Spelling=name
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=153708&r1=153707&r2=153708&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Mar 29 19:19:13 2012
@@ -2944,6 +2944,8 @@
return Ivar->getLocation();
if (SizeOfPackExpr *SizeOfPack = dyn_cast<SizeOfPackExpr>(E))
return SizeOfPack->getPackLoc();
+ if (ObjCPropertyRefExpr *PropRef = dyn_cast<ObjCPropertyRefExpr>(E))
+ return PropRef->getLocation();
return E->getLocStart();
}
More information about the cfe-commits
mailing list