Pass from the parser the locations of selector identifiers when creating
objc method decls.
They are not stored in the AST yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140984 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 23e4474..3a34ffb 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -2489,7 +2489,7 @@
SourceLocation MethodLoc, SourceLocation EndLoc,
tok::TokenKind MethodType,
ObjCDeclSpec &ReturnQT, ParsedType ReturnType,
- SourceLocation SelectorStartLoc,
+ ArrayRef<SourceLocation> SelectorLocs,
Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
@@ -2523,11 +2523,12 @@
} else { // get the type for "id".
resultDeclType = Context.getObjCIdType();
Diag(MethodLoc, diag::warn_missing_method_return_type)
- << FixItHint::CreateInsertion(SelectorStartLoc, "(id)");
+ << FixItHint::CreateInsertion(SelectorLocs.front(), "(id)");
}
ObjCMethodDecl* ObjCMethod =
- ObjCMethodDecl::Create(Context, MethodLoc, EndLoc, Sel, resultDeclType,
+ ObjCMethodDecl::Create(Context, MethodLoc, EndLoc, SelectorLocs, Sel,
+ resultDeclType,
ResultTInfo,
CurContext,
MethodType == tok::minus, isVariadic,
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 655adde..a6f21fb 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1518,6 +1518,7 @@
property->getLocation();
GetterMethod = ObjCMethodDecl::Create(Context, Loc, Loc,
+ ArrayRef<SourceLocation>(),
property->getGetterName(),
property->getType(), 0, CD, /*isInstance=*/true,
/*isVariadic=*/false, /*isSynthesized=*/true,
@@ -1555,7 +1556,7 @@
property->getLocation();
SetterMethod =
- ObjCMethodDecl::Create(Context, Loc, Loc,
+ ObjCMethodDecl::Create(Context, Loc, Loc, ArrayRef<SourceLocation>(),
property->getSetterName(), Context.VoidTy, 0,
CD, /*isInstance=*/true, /*isVariadic=*/false,
/*isSynthesized=*/true,