From b8c3aaf479394516454c8ca617ca9cb6377130d2 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 3 Oct 2011 06:37:04 +0000 Subject: Allow getting all source locations of selector identifiers in a ObjCMethodDecl. Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989 --- clang/lib/Sema/SemaObjCProperty.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaObjCProperty.cpp') diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index a6f21fbf963..80c44090748 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1518,7 +1518,6 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, property->getLocation(); GetterMethod = ObjCMethodDecl::Create(Context, Loc, Loc, - ArrayRef(), property->getGetterName(), property->getType(), 0, CD, /*isInstance=*/true, /*isVariadic=*/false, /*isSynthesized=*/true, @@ -1556,7 +1555,7 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, property->getLocation(); SetterMethod = - ObjCMethodDecl::Create(Context, Loc, Loc, ArrayRef(), + ObjCMethodDecl::Create(Context, Loc, Loc, property->getSetterName(), Context.VoidTy, 0, CD, /*isInstance=*/true, /*isVariadic=*/false, /*isSynthesized=*/true, @@ -1577,7 +1576,8 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, SC_None, SC_None, 0); - SetterMethod->setMethodParams(Context, &Argument, 1); + SetterMethod->setMethodParams(Context, Argument, + ArrayRef()); AddPropertyAttrs(*this, SetterMethod, property); -- cgit v1.2.3