summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-17 01:03:52 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-17 01:03:52 +0000
commitb1b71e50a0767f429122c92d38c9e227472fb26d (patch)
tree8e5e06b6726aae03207a2a29b44301fd7d420163 /clang/lib/AST/DeclObjC.cpp
parentbcc230a7653624d5e2854e4718dbf9fe07aacd9f (diff)
downloadbcm5719-llvm-b1b71e50a0767f429122c92d38c9e227472fb26d.tar.gz
bcm5719-llvm-b1b71e50a0767f429122c92d38c9e227472fb26d.zip
For an Objective-C @synthesize statement, e.g.,
@synthesize foo = _foo; keep track of the location of the ivar ("_foo"). Teach libclang to visit the ivar as a member reference. llvm-svn: 119447
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 817f7073af1..5e57cf87b9e 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -896,7 +896,6 @@ ObjCPropertyDecl *ObjCPropertyDecl::Create(ASTContext &C, DeclContext *DC,
return new (C) ObjCPropertyDecl(DC, L, Id, AtLoc, T);
}
-
//===----------------------------------------------------------------------===//
// ObjCPropertyImplDecl
//===----------------------------------------------------------------------===//
@@ -907,8 +906,16 @@ ObjCPropertyImplDecl *ObjCPropertyImplDecl::Create(ASTContext &C,
SourceLocation L,
ObjCPropertyDecl *property,
Kind PK,
- ObjCIvarDecl *ivar) {
- return new (C) ObjCPropertyImplDecl(DC, atLoc, L, property, PK, ivar);
+ ObjCIvarDecl *ivar,
+ SourceLocation ivarLoc) {
+ return new (C) ObjCPropertyImplDecl(DC, atLoc, L, property, PK, ivar,
+ ivarLoc);
}
+SourceRange ObjCPropertyImplDecl::getSourceRange() const {
+ SourceLocation EndLoc = getLocation();
+ if (IvarLoc.isValid())
+ EndLoc = IvarLoc;
+ return SourceRange(AtLoc, EndLoc);
+}
OpenPOWER on IntegriCloud