return NULL;
}
+int ObjCMethodDecl::getSynthesizedSelectorSize() const {
+ // syntesized method name is a concatenation of -/+[class-name selector]
+ // Get length of this name.
+ int length = 4; // for '+' or '-', '[', space in between and ']'
+ length += getSelector().getName().size(); // for selector name.
+ length += strlen(getMethodContext()->getName()); // for its class name
+ return length;
+}
+
ObjCInterfaceDecl *const ObjCMethodDecl::getClassInterface() const {
if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(MethodContext))
return ID;
if (CurFunctionDecl)
Length = CurFunctionDecl->getIdentifier()->getLength();
else
- Length = CurMethodDecl->getSelector().getName().size();
+ Length = CurMethodDecl->getSynthesizedSelectorSize();
llvm::APInt LengthI(32, Length + 1);
QualType ResTy = Context.CharTy.getQualifiedType(QualType::Const);
ObjCInterfaceDecl *const getClassInterface() const;
Selector getSelector() const { return SelName; }
+ int getSynthesizedSelectorSize() const;
QualType getResultType() const { return MethodDeclType; }
// Iterator access to formal parameters.