diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-12-05 11:25:46 -0800 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-12-05 12:45:10 -0800 |
commit | a1a9aa17b4db08937e458cdda85327b9eff307df (patch) | |
tree | 1228ab2d33e935558a46ce57ae69136e9724b68d /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | d0b9ed5c490ef10e4af750720a65a6cc6ba41af2 (diff) | |
download | bcm5719-llvm-a1a9aa17b4db08937e458cdda85327b9eff307df.tar.gz bcm5719-llvm-a1a9aa17b4db08937e458cdda85327b9eff307df.zip |
Set a source location for Objective-C accessor stubs
even when there is no explicit synthesize statement.
This fixes a regression introduced in https://reviews.llvm.org/D68108
that could lead to missing debug locations in cleanup code in
synthesized Objective-C++ properties.
rdar://57630879
Differential Revision: https://reviews.llvm.org/D71084
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 87f7baaf568..2d91ea1f5fd 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1058,11 +1058,13 @@ RedeclarePropertyAccessor(ASTContext &Context, ObjCImplementationDecl *Impl, SourceLocation PropertyLoc) { ObjCMethodDecl *Decl = AccessorDecl; ObjCMethodDecl *ImplDecl = ObjCMethodDecl::Create( - Context, AtLoc, PropertyLoc, Decl->getSelector(), Decl->getReturnType(), + Context, AtLoc.isValid() ? AtLoc : Decl->getBeginLoc(), + PropertyLoc.isValid() ? PropertyLoc : Decl->getEndLoc(), + Decl->getSelector(), Decl->getReturnType(), Decl->getReturnTypeSourceInfo(), Impl, Decl->isInstanceMethod(), - Decl->isVariadic(), Decl->isPropertyAccessor(), /* isSynthesized*/ true, - Decl->isImplicit(), Decl->isDefined(), Decl->getImplementationControl(), - Decl->hasRelatedResultType()); + Decl->isVariadic(), Decl->isPropertyAccessor(), + /* isSynthesized*/ true, Decl->isImplicit(), Decl->isDefined(), + Decl->getImplementationControl(), Decl->hasRelatedResultType()); ImplDecl->getMethodFamily(); if (Decl->hasAttrs()) ImplDecl->setAttrs(Decl->getAttrs()); |