From: Nicola Pero Date: Thu, 9 Jun 2011 16:34:19 +0000 (+0000) Subject: In gcc/testsuite/: 2011-06-09 Nicola Pero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe6d49b86ad2de846737ad57f30f370b2a3cfda0;p=gcc.git In gcc/testsuite/: 2011-06-09 Nicola Pero In gcc/testsuite/: 2011-06-09 Nicola Pero * objc-obj-c++-shared/objc-test-suite-next-encode-assist.h (PMETH, arglist_t): Removed. (method_get_number_of_arguments): Removed. (method_get_nth_argument): Removed. (method_get_first_argument): Removed. (method_get_next_argument): Removed. (method_get_sizeof_arguments): Removed. * objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h (PMETH): Removed. (method_get_number_of_arguments): Removed. (method_get_nth_argument): Removed. (method_get_first_argument): Removed. (method_get_next_argument): Removed. (method_get_sizeof_arguments): Removed. * objc-obj-c++-shared/objc-test-suite-types.h (PMETH): Removed. From-SVN: r174851 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b63904b0977..12f41f641ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,21 @@ +2011-06-09 Nicola Pero + + * objc-obj-c++-shared/objc-test-suite-next-encode-assist.h + (PMETH, arglist_t): Removed. + (method_get_number_of_arguments): Removed. + (method_get_nth_argument): Removed. + (method_get_first_argument): Removed. + (method_get_next_argument): Removed. + (method_get_sizeof_arguments): Removed. + * objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h + (PMETH): Removed. + (method_get_number_of_arguments): Removed. + (method_get_nth_argument): Removed. + (method_get_first_argument): Removed. + (method_get_next_argument): Removed. + (method_get_sizeof_arguments): Removed. + * objc-obj-c++-shared/objc-test-suite-types.h (PMETH): Removed. + 2011-06-09 David Li * testsuite/gcc.dg/dump-pass.c: New test. diff --git a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h index 6a4b4ceed42..5508eddd757 100644 --- a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h +++ b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h @@ -7,10 +7,8 @@ #include "next-abi.h" #ifdef NEXT_OBJC_USE_NEW_INTERFACE #include -typedef void * PMETH; #else #include -typedef struct objc_method * PMETH; #endif /* ---- */ @@ -486,135 +484,6 @@ objc_skip_argspec (const char *type) type = objc_skip_offset (type); return type; } -/* - Return the number of arguments that the method MTH expects. - Note that all methods need two implicit arguments `self' and - `_cmd'. -*/ -int -method_get_number_of_arguments (PMETH mth) -{ - int i = 0; -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - const char *type = method_getTypeEncoding((Method)mth); -#else - const char *type = mth->method_types; -#endif - while (*type) - { - type = objc_skip_argspec (type); - i += 1; - } - return i - 1; -} - -/* - Return the size of the argument block needed on the stack to invoke - the method MTH. This may be zero, if all arguments are passed in - registers. -*/ - -int -method_get_sizeof_arguments (PMETH mth) -{ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - const char *type = objc_skip_typespec (method_getTypeEncoding((Method)mth)); -#else - const char *type = objc_skip_typespec (mth->method_types); -#endif - return atoi (type); -} - -/* - Return a pointer to the next argument of ARGFRAME. type points to - the last argument. Typical use of this look like: - - { - char *datum, *type; - for (datum = method_get_first_argument (method, argframe, &type); - datum; datum = method_get_next_argument (argframe, &type)) - { - unsigned flags = objc_get_type_qualifiers (type); - type = objc_skip_type_qualifiers (type); - if (*type != _C_PTR) - [portal encodeData: datum ofType: type]; - else - { - if ((flags & _F_IN) == _F_IN) - [portal encodeData: *(char **) datum ofType: ++type]; - } - } - } -*/ - -char * -method_get_next_argument (arglist_t argframe, const char **type) -{ - const char *t = objc_skip_argspec (*type); - - if (*t == '\0') - return 0; - - *type = t; - t = objc_skip_typespec (t); - - if (*t == '+') - return argframe->arg_regs + atoi (++t); - else - return argframe->arg_ptr + atoi (t); -} - -/* - Return a pointer to the value of the first argument of the method - described in M with the given argumentframe ARGFRAME. The type - is returned in TYPE. type must be passed to successive calls of - method_get_next_argument. -*/ -char * -method_get_first_argument (PMETH m, - arglist_t argframe, - const char **type) -{ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - *type = method_getTypeEncoding((Method)m); -#else - *type = m->method_types; -#endif - - return method_get_next_argument (argframe, type); -} - -/* - Return a pointer to the ARGth argument of the method - M from the frame ARGFRAME. The type of the argument - is returned in the value-result argument TYPE -*/ - -char * -method_get_nth_argument (PMETH m, - arglist_t argframe, int arg, - const char **type) -{ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - const char *t = objc_skip_argspec (method_getTypeEncoding((Method)m)); -#else - const char *t = objc_skip_argspec (m->method_types); -#endif - - if (arg > method_get_number_of_arguments (m)) - return 0; - - while (arg--) - t = objc_skip_argspec (t); - - *type = t; - t = objc_skip_typespec (t); - - if (*t == '+') - return argframe->arg_regs + atoi (++t); - else - return argframe->arg_ptr + atoi (t); -} unsigned objc_get_type_qualifiers (const char *type) diff --git a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist.h b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist.h index af02b278a2e..e62944560ec 100644 --- a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist.h +++ b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-next-encode-assist.h @@ -6,10 +6,8 @@ #include "next-abi.h" #ifdef NEXT_OBJC_USE_NEW_INTERFACE #include -typedef void * PMETH; #else #include -typedef struct objc_method * PMETH; /* Missing from old NeXT objc headers... */ #define _C_LNG_LNG 'q' @@ -54,11 +52,6 @@ struct objc_struct_layout unsigned int record_align; }; -typedef union arglist { - char *arg_ptr; - char arg_regs[sizeof (char*)]; -} *arglist_t; /* argument frame */ - void objc_layout_structure_get_info (struct objc_struct_layout *,unsigned int *, unsigned int *, const char **); void objc_layout_structure (const char *, struct objc_struct_layout *); @@ -77,11 +70,5 @@ const char *objc_skip_typespec (const char *); const char *objc_skip_offset (const char *); const char *objc_skip_argspec (const char *); -int method_get_number_of_arguments (PMETH); -int method_get_sizeof_arguments (PMETH); -char *method_get_next_argument (arglist_t , const char **); -char *method_get_first_argument (PMETH, arglist_t, const char **); -char *method_get_nth_argument (PMETH, arglist_t, int, const char **); - #endif /* __NEXT_RUNTIME__ */ #endif /* _OBJC_TEST_SUITE_NEXT_ENCODE_ASSIST_H_ */ diff --git a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-types.h b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-types.h index edff8cb0207..34981edfc77 100644 --- a/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-types.h +++ b/gcc/testsuite/objc-obj-c++-shared/objc-test-suite-types.h @@ -45,11 +45,6 @@ typedef void * TNS_STRING_REF_T; /* Where there are equivalent interfaces between APIs we substitute a macro or typedef. */ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -typedef void * PMETH; -#else -typedef struct objc_method * PMETH; -#endif #ifdef __OBJC2__ /* Const String Class ref. */