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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140989 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index a6f21fb..80c4409 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1518,7 +1518,6 @@
property->getLocation();
GetterMethod = ObjCMethodDecl::Create(Context, Loc, Loc,
- ArrayRef<SourceLocation>(),
property->getGetterName(),
property->getType(), 0, CD, /*isInstance=*/true,
/*isVariadic=*/false, /*isSynthesized=*/true,
@@ -1556,7 +1555,7 @@
property->getLocation();
SetterMethod =
- ObjCMethodDecl::Create(Context, Loc, Loc, ArrayRef<SourceLocation>(),
+ ObjCMethodDecl::Create(Context, Loc, Loc,
property->getSetterName(), Context.VoidTy, 0,
CD, /*isInstance=*/true, /*isVariadic=*/false,
/*isSynthesized=*/true,
@@ -1577,7 +1576,8 @@
SC_None,
SC_None,
0);
- SetterMethod->setMethodParams(Context, &Argument, 1);
+ SetterMethod->setMethodParams(Context, Argument,
+ ArrayRef<SourceLocation>());
AddPropertyAttrs(*this, SetterMethod, property);