diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-17 01:03:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-17 01:03:52 +0000 |
commit | a4ffd85a6684e42f900aad5459e58ad91bb88755 (patch) | |
tree | 7675a1f7f57a054e26c60c87ddd2532a844a08ae /lib/Parse/ParseObjc.cpp | |
parent | 1e7e877091187556bb6d644ab2b7c00a628121eb (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index d18efac5e2..c01bea9cb5 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -1431,6 +1431,7 @@ Decl *Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { IdentifierInfo *propertyIvar = 0; IdentifierInfo *propertyId = Tok.getIdentifierInfo(); SourceLocation propertyLoc = ConsumeToken(); // consume property name + SourceLocation propertyIvarLoc; if (Tok.is(tok::equal)) { // property '=' ivar-name ConsumeToken(); // consume '=' @@ -1446,10 +1447,10 @@ Decl *Parser::ParseObjCPropertySynthesize(SourceLocation atLoc) { break; } propertyIvar = Tok.getIdentifierInfo(); - ConsumeToken(); // consume ivar-name + propertyIvarLoc = ConsumeToken(); // consume ivar-name } Actions.ActOnPropertyImplDecl(getCurScope(), atLoc, propertyLoc, true, ObjCImpDecl, - propertyId, propertyIvar); + propertyId, propertyIvar, propertyIvarLoc); if (Tok.isNot(tok::comma)) break; ConsumeToken(); // consume ',' @@ -1489,7 +1490,7 @@ Decl *Parser::ParseObjCPropertyDynamic(SourceLocation atLoc) { IdentifierInfo *propertyId = Tok.getIdentifierInfo(); SourceLocation propertyLoc = ConsumeToken(); // consume property name Actions.ActOnPropertyImplDecl(getCurScope(), atLoc, propertyLoc, false, ObjCImpDecl, - propertyId, 0); + propertyId, 0, SourceLocation()); if (Tok.isNot(tok::comma)) break; |