aboutsummaryrefslogtreecommitdiff
path: root/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/Decl.cpp')
-rw-r--r--AST/Decl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index bf1ffee832..d80b5eea80 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -549,6 +549,15 @@ ObjCMethodDecl *ObjCProtocolDecl::lookupClassMethod(Selector Sel) {
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;