summaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-08 21:17:33 +0000
committerRichard Stallman <rms@gnu.org>1993-03-08 21:17:33 +0000
commit187e4b0f22718012d2138b29c9536c68b088653c (patch)
treebaec7bec24d2354067027d50aef7e0cbb02d32f4 /gcc/objc/objc-act.c
parent6092a4cc83dde89cabef5cd97e033364db1ff677 (diff)
downloadgcc-187e4b0f22718012d2138b29c9536c68b088653c.tar.gz
(really_start_method): Always use OBJC_GEN_METHOD_LABEL.
Pass method_slot as additional arg. (OBJC_GEN_METHOD_LABEL): Add default definition. From-SVN: r3677
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r--gcc/objc/objc-act.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 8ba9f555373..24c401f2c67 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -52,6 +52,18 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
so it can store the operation numbers in them. */
#ifndef NEXT_OBJC_RUNTIME
#define OBJC_SELECTORS_WITHOUT_LABELS
+
+/* This is the default way of generating a method name. */
+#ifndef OBJC_GEN_METHOD_LABEL
+#define OBJC_GEN_METHOD_LABEL(BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME, NUM) \
+ do { \
+ char *cat_name = (CAT_NAME); \
+ if (cat_name == 0) cat_name = ""; \
+ sprintf ((BUF), "_%s_%s_%s_%s_%d", \
+ ((IS_INST) ? "i" : "c"), \
+ (CLASS_NAME), cat_name, \
+ (SEL_NAME), (NUM)); \
+ } while (0)
#endif
/* Define the special tree codes that we use. */
@@ -4160,16 +4172,12 @@ really_start_method (method, parmlist)
buf = (char *) alloca (50
+ strlen (IDENTIFIER_POINTER (METHOD_SEL_NAME (method)))
+ strlen (IDENTIFIER_POINTER (CLASS_NAME (implementation_context))));
-#ifdef OBJC_GEN_METHOD_LABEL
OBJC_GEN_METHOD_LABEL (buf,
TREE_CODE (method) == INSTANCE_METHOD_DECL,
IDENTIFIER_POINTER (CLASS_NAME (implementation_context)),
NULL,
- IDENTIFIER_POINTER (METHOD_SEL_NAME (method)));
-#else
- sprintf (buf, "_%d_%s", ++method_slot,
- IDENTIFIER_POINTER (CLASS_NAME (implementation_context)));
-#endif
+ IDENTIFIER_POINTER (METHOD_SEL_NAME (method)),
+ ++method_slot);
}
else /* we have a category */
{
@@ -4178,17 +4186,12 @@ really_start_method (method, parmlist)
+ strlen (IDENTIFIER_POINTER (METHOD_SEL_NAME (method)))
+ strlen (IDENTIFIER_POINTER (CLASS_SUPER_NAME (implementation_context)))
+ strlen (IDENTIFIER_POINTER (CLASS_NAME (implementation_context))));
-#ifdef OBJC_GEN_METHOD_LABEL
- OBJC_GEN_METHOD_LABEL (buf,
+ OBJC_GEN_METHOD_LABEL (buf,
TREE_CODE (method) == INSTANCE_METHOD_DECL,
IDENTIFIER_POINTER (CLASS_NAME (implementation_context)),
IDENTIFIER_POINTER (CLASS_SUPER_NAME (implementation_context)),
- IDENTIFIER_POINTER (METHOD_SEL_NAME (method)));
-#else
- sprintf (buf, "_%d_%s_%s", ++method_slot,
- IDENTIFIER_POINTER (CLASS_NAME (implementation_context)),
- IDENTIFIER_POINTER (CLASS_SUPER_NAME (implementation_context)));
-#endif
+ IDENTIFIER_POINTER (METHOD_SEL_NAME (method)),
+ ++method_slot);
}
method_id = get_identifier (buf);