/// in, inout, etc.
unsigned objcDeclQualifier : 6;
+ // Number of args separated by ':' in a method declaration.
+ unsigned NumSelectorArgs;
+
// Result type of this method.
QualType MethodDeclType;
bool isInstance = true,
bool isVariadic = false,
bool isSynthesized = false,
- ImplementationControl impControl = None)
+ ImplementationControl impControl = None,
+ unsigned numSelectorArgs = 0)
: NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),
DeclContext(ObjCMethod),
IsInstance(isInstance), IsVariadic(isVariadic),
IsSynthesized(isSynthesized),
DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None),
- MethodDeclType(T), ResultTInfo(ResultTInfo),
+ NumSelectorArgs(numSelectorArgs), MethodDeclType(T),
+ ResultTInfo(ResultTInfo),
EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {}
virtual ~ObjCMethodDecl() {}
bool isInstance = true,
bool isVariadic = false,
bool isSynthesized = false,
- ImplementationControl impControl = None);
+ ImplementationControl impControl = None,
+ unsigned numSelectorArgs = 0);
virtual ObjCMethodDecl *getCanonicalDecl();
const ObjCMethodDecl *getCanonicalDecl() const {
}
void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; }
+ unsigned getNumSelectorArgs() const { return NumSelectorArgs; }
+ void setNumSelectorArgs(unsigned numSelectorArgs) {
+ NumSelectorArgs = numSelectorArgs;
+ }
+
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const { return getLocation(); }
SourceLocation getLocEnd() const { return EndLoc; }
typedef ObjCList<ParmVarDecl>::iterator param_iterator;
param_iterator param_begin() const { return ParamInfo.begin(); }
param_iterator param_end() const { return ParamInfo.end(); }
+ // This method returns and of the parameters which are part of the selector
+ // name mangling requirements.
+ param_iterator sel_param_end() const {
+ return ParamInfo.begin() + NumSelectorArgs;
+ }
void setMethodParams(ASTContext &C, ParmVarDecl *const *List, unsigned Num) {
ParamInfo.set(List, Num, C);
// their size.
CharUnits ParmOffset = 2 * PtrSize;
for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
- E = Decl->param_end(); PI != E; ++PI) {
+ E = Decl->sel_param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType();
CharUnits sz = getObjCEncodingTypeSize(PType);
assert (sz.isPositive() &&
// Argument types.
ParmOffset = 2 * PtrSize;
for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
- E = Decl->param_end(); PI != E; ++PI) {
+ E = Decl->sel_param_end(); PI != E; ++PI) {
ParmVarDecl *PVDecl = *PI;
QualType PType = PVDecl->getOriginalType();
if (const ArrayType *AT =
bool isInstance,
bool isVariadic,
bool isSynthesized,
- ImplementationControl impControl) {
+ ImplementationControl impControl,
+ unsigned numSelectorArgs) {
return new (C) ObjCMethodDecl(beginLoc, endLoc,
SelInfo, T, ResultTInfo, contextDecl,
isInstance,
- isVariadic, isSynthesized, impControl);
+ isVariadic, isSynthesized, impControl,
+ numSelectorArgs);
}
void ObjCMethodDecl::Destroy(ASTContext &C) {