This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename unop_aux_stringify to multideref_stringify
authorDavid Mitchell <davem@iabyn.com>
Tue, 27 Jan 2015 11:14:37 +0000 (11:14 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 27 Jan 2015 11:14:37 +0000 (11:14 +0000)
This function returns a string representation of the OP_MULTIDEREF op
(as used by the output of perl -Dt).

However, the stringification of a UNOP_AUX op is op-specific, and
hypothetical future UNOP_AUX-class ops will need their own functions.
So the current function name is misleading.

It should be safe to rename it, as it only been in since 5.21.7, and isn't
public.

dump.c
embed.fnc
embed.h
ext/B/B.xs
proto.h

diff --git a/dump.c b/dump.c
index 0ed7962..24ce93e 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -2327,11 +2327,11 @@ S_append_gv_name(pTHX_ GV *gv, SV *out)
 
 
 /* return a temporary SV containing a stringified representation of
- * the op_aux field of a UNOP_AUX op, associated with CV cv
+ * the op_aux field of a MULTIDEREF op, associated with CV cv
  */
 
 SV*
-Perl_unop_aux_stringify(pTHX_ const OP *o, CV *cv)
+Perl_multideref_stringify(pTHX_ const OP *o, CV *cv)
 {
     UNOP_AUX_item *items = cUNOP_AUXo->op_aux;
     UV actions = items->uv;
@@ -2345,7 +2345,7 @@ Perl_unop_aux_stringify(pTHX_ const OP *o, CV *cv)
     PAD *comppad = PadlistARRAY(padlist)[1];
 #endif
 
-    PERL_ARGS_ASSERT_UNOP_AUX_STRINGIFY;
+    PERL_ARGS_ASSERT_MULTIDEREF_STRINGIFY;
 
     while (!last) {
         switch (actions & MDEREF_ACTION_MASK) {
@@ -2498,7 +2498,7 @@ Perl_debop(pTHX_ const OP *o)
 
     case OP_MULTIDEREF:
         PerlIO_printf(Perl_debug_log, "(%-p)",
-            unop_aux_stringify(o, deb_curcv(cxstack_ix)));
+            multideref_stringify(o, deb_curcv(cxstack_ix)));
         break;
 
     default:
index 88cb1c3..220acd7 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -330,7 +330,7 @@ ApR |I32    |cxinc
 Afp    |void   |deb            |NN const char* pat|...
 Ap     |void   |vdeb           |NN const char* pat|NULLOK va_list* args
 Ap     |void   |debprofdump
-EXp    |SV*    |unop_aux_stringify     |NN const OP* o|NN CV *cv
+EXp    |SV*    |multideref_stringify   |NN const OP* o|NN CV *cv
 Ap     |I32    |debop          |NN const OP* o
 Ap     |I32    |debstack
 Ap     |I32    |debstackptrs
diff --git a/embed.h b/embed.h
index 28fedea..76a3029 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define current_re_engine()    Perl_current_re_engine(aTHX)
 #define cv_ckproto_len_flags(a,b,c,d,e)        Perl_cv_ckproto_len_flags(aTHX_ a,b,c,d,e)
 #define mg_find_mglob(a)       Perl_mg_find_mglob(aTHX_ a)
+#define multideref_stringify(a,b)      Perl_multideref_stringify(aTHX_ a,b)
 #define op_clear(a)            Perl_op_clear(aTHX_ a)
 #define qerror(a)              Perl_qerror(aTHX_ a)
 #define reg_named_buff(a,b,c,d)        Perl_reg_named_buff(aTHX_ a,b,c,d)
 #define reg_temp_copy(a,b)     Perl_reg_temp_copy(aTHX_ a,b)
 #define report_uninit(a)       Perl_report_uninit(aTHX_ a)
 #define sv_magicext_mglob(a)   Perl_sv_magicext_mglob(aTHX_ a)
-#define unop_aux_stringify(a,b)        Perl_unop_aux_stringify(aTHX_ a,b)
 #define validate_proto(a,b,c)  Perl_validate_proto(aTHX_ a,b,c)
 #define vivify_defelem(a)      Perl_vivify_defelem(aTHX_ a)
 #define yylex()                        Perl_yylex(aTHX)
index 703efc0..31e855b 100644 (file)
@@ -1359,7 +1359,7 @@ string(o, cv)
     PPCODE:
         switch (o->op_type) {
         case OP_MULTIDEREF:
-            ret = unop_aux_stringify(o, cv);
+            ret = multideref_stringify(o, cv);
             break;
         default:
             ret = sv_2mortal(newSVpvn("", 0));
diff --git a/proto.h b/proto.h
index 20b8b35..9f68fac 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2773,6 +2773,12 @@ PERL_CALLCONV SV*        Perl_mro_set_private_data(pTHX_ struct mro_meta *const smeta,
 #define PERL_ARGS_ASSERT_MRO_SET_PRIVATE_DATA  \
        assert(smeta); assert(which); assert(data)
 
+PERL_CALLCONV SV*      Perl_multideref_stringify(pTHX_ const OP* o, CV *cv)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_MULTIDEREF_STRINGIFY  \
+       assert(o); assert(cv)
+
 PERL_CALLCONV NV       Perl_my_atof(pTHX_ const char *s)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_MY_ATOF       \
@@ -4964,12 +4970,6 @@ PERL_CALLCONV UV Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, S
 
 PERL_CALLCONV bool     Perl_try_amagic_bin(pTHX_ int method, int flags);
 PERL_CALLCONV bool     Perl_try_amagic_un(pTHX_ int method, int flags);
-PERL_CALLCONV SV*      Perl_unop_aux_stringify(pTHX_ const OP* o, CV *cv)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_UNOP_AUX_STRINGIFY    \
-       assert(o); assert(cv)
-
 PERL_CALLCONV I32      Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)