diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-03-16 18:25:40 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-03-16 18:25:40 +0000 |
| commit | 194b28ebb14d138b058f7902540b9e88958c3c24 (patch) | |
| tree | e2b7864d5efc490acad5d697db61882dd03cdf4a /clang/lib/Serialization | |
| parent | 4377314a98d3f6c905d2c52c7a4d480a1a73c124 (diff) | |
| download | bcm5719-llvm-194b28ebb14d138b058f7902540b9e88958c3c24.tar.gz bcm5719-llvm-194b28ebb14d138b058f7902540b9e88958c3c24.zip | |
[index/AST] Add references for ObjC getter=/setter= property attributes and related property getter/setter role fixes
This enhances the AST to keep track of locations of the names in those ObjC property attributes, and reports them for indexing.
Patch by Nathan Hawes!
https://reviews.llvm.org/D30907
llvm-svn: 297972
Diffstat (limited to 'clang/lib/Serialization')
| -rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index d33a4759278..a0ca321bc79 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -1124,8 +1124,10 @@ void ASTDeclReader::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { (ObjCPropertyDecl::PropertyAttributeKind)Record.readInt()); D->setPropertyImplementation( (ObjCPropertyDecl::PropertyControl)Record.readInt()); - D->setGetterName(Record.readDeclarationName().getObjCSelector()); - D->setSetterName(Record.readDeclarationName().getObjCSelector()); + D->setGetterName(Record.readDeclarationName().getObjCSelector(), + ReadSourceLocation()); + D->setSetterName(Record.readDeclarationName().getObjCSelector(), + ReadSourceLocation()); D->setGetterMethodDecl(ReadDeclAs<ObjCMethodDecl>()); D->setSetterMethodDecl(ReadDeclAs<ObjCMethodDecl>()); D->setPropertyIvarDecl(ReadDeclAs<ObjCIvarDecl>()); diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 190d3975b70..41b9a97c78f 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -799,7 +799,9 @@ void ASTDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { // FIXME: stable encoding Record.push_back((unsigned)D->getPropertyImplementation()); Record.AddDeclarationName(D->getGetterName()); + Record.AddSourceLocation(D->getGetterNameLoc()); Record.AddDeclarationName(D->getSetterName()); + Record.AddSourceLocation(D->getSetterNameLoc()); Record.AddDeclRef(D->getGetterMethodDecl()); Record.AddDeclRef(D->getSetterMethodDecl()); Record.AddDeclRef(D->getPropertyIvarDecl()); |

