public:
static ObjCMethodDecl *Create(ASTContext &C,
SourceLocation beginLoc,
- SourceLocation endLoc, Selector SelInfo,
+ SourceLocation endLoc,
+ ArrayRef<SourceLocation> SelLocs,
+ Selector SelInfo,
QualType T,
TypeSourceInfo *ResultTInfo,
DeclContext *contextDecl,
SourceLocation EndLoc, // location of the ; or {.
tok::TokenKind MethodType,
ObjCDeclSpec &ReturnQT, ParsedType ReturnType,
- SourceLocation SelectorStartLoc, Selector Sel,
+ ArrayRef<SourceLocation> SelectorLocs, Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
ObjCArgInfo *ArgInfo,
= ObjCMethodDecl::Create(Importer.getToContext(),
Loc,
Importer.Import(D->getLocEnd()),
+ /*FIXME:*/ ArrayRef<SourceLocation>(),
Name.getObjCSelector(),
ResultTy, ResultTInfo, DC,
D->isInstanceMethod(),
ObjCMethodDecl *ObjCMethodDecl::Create(ASTContext &C,
SourceLocation beginLoc,
SourceLocation endLoc,
+ ArrayRef<SourceLocation> SelLocs,
Selector SelInfo, QualType T,
TypeSourceInfo *ResultTInfo,
DeclContext *contextDecl,
Selector cxxSelector = getContext().Selectors.getSelector(0, &II);
ObjCMethodDecl *DTORMethod =
ObjCMethodDecl::Create(getContext(), D->getLocation(), D->getLocation(),
+ ArrayRef<SourceLocation>(),
cxxSelector, getContext().VoidTy, 0, D,
/*isInstance=*/true, /*isVariadic=*/false,
/*isSynthesized=*/true, /*isImplicitlyDeclared=*/true,
// The constructor returns 'self'.
ObjCMethodDecl *CTORMethod = ObjCMethodDecl::Create(getContext(),
D->getLocation(),
- D->getLocation(), cxxSelector,
+ D->getLocation(),
+ ArrayRef<SourceLocation>(),
+ cxxSelector,
getContext().getObjCIdType(), 0,
D, /*isInstance=*/true,
/*isVariadic=*/false,
}
SmallVector<IdentifierInfo *, 12> KeyIdents;
+ SmallVector<SourceLocation, 12> KeyLocs;
SmallVector<Sema::ObjCArgInfo, 12> ArgInfos;
ParseScope PrototypeScope(this,
Scope::FunctionPrototypeScope|Scope::DeclScope);
ArgInfos.push_back(ArgInfo);
KeyIdents.push_back(SelIdent);
+ KeyLocs.push_back(selLoc);
// Make sure the attributes persist.
allParamAttrs.takeAllFrom(paramAttrs.getPool());
}
// Check for another keyword selector.
- SourceLocation Loc;
- SelIdent = ParseObjCSelectorPiece(Loc);
+ SelIdent = ParseObjCSelectorPiece(selLoc);
if (!SelIdent && Tok.isNot(tok::colon))
break;
// We have a selector or a colon, continue parsing.
Decl *Result
= Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
mType, DSRet, ReturnType,
- selLoc, Sel, &ArgInfos[0],
+ KeyLocs, Sel, &ArgInfos[0],
CParamInfo.data(), CParamInfo.size(),
methodAttrs.getList(),
MethodImplKind, isVariadic, MethodDefinition);
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().
} 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,
property->getLocation();
GetterMethod = ObjCMethodDecl::Create(Context, Loc, Loc,
+ ArrayRef<SourceLocation>(),
property->getGetterName(),
property->getType(), 0, CD, /*isInstance=*/true,
/*isVariadic=*/false, /*isSynthesized=*/true,
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,
case DECL_OBJC_METHOD:
D = ObjCMethodDecl::Create(Context, SourceLocation(), SourceLocation(),
+ ArrayRef<SourceLocation>(),
Selector(), QualType(), 0, 0);
break;
case DECL_OBJC_INTERFACE: