summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-14 09:16:30 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 10:12:19 +0200
commitb2e9fc6f32369f6de4f37da887e1e7c4a48dd506 (patch)
treea8aefa2f4b77608f5800a458ee8ab8f14d823f6a
parentc7fdacb978df1723dbbd70b5517ff77db208a23e (diff)
downloadperl-b2e9fc6f32369f6de4f37da887e1e7c4a48dd506.tar.gz
PL_vtbl_{bm,fm} can be aliases to PL_vtbl_regexp, instead of copies.
They became copies in 488344d27a84a21a, which merged Perl_magic_setbm() and Perl_magic_setfm() into Perl_magic_setregexp().
-rw-r--r--mg_vtable.h7
-rw-r--r--regen/mg_vtable.pl10
2 files changed, 10 insertions, 7 deletions
diff --git a/mg_vtable.h b/mg_vtable.h
index 2db8f3fe8c..52937d7460 100644
--- a/mg_vtable.h
+++ b/mg_vtable.h
@@ -24,8 +24,6 @@ enum { /* pass one of these to get_vtbl */
want_vtbl_substr,
want_vtbl_vec,
want_vtbl_pos,
- want_vtbl_bm,
- want_vtbl_fm,
want_vtbl_uvar,
want_vtbl_defelem,
want_vtbl_regexp,
@@ -82,8 +80,6 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = {
{ Perl_magic_getsubstr, Perl_magic_setsubstr, 0, 0, 0, 0, 0, 0 },
{ Perl_magic_getvec, Perl_magic_setvec, 0, 0, 0, 0, 0, 0 },
{ Perl_magic_getpos, Perl_magic_setpos, 0, 0, 0, 0, 0, 0 },
- { 0, Perl_magic_setregexp, 0, 0, 0, 0, 0, 0 },
- { 0, Perl_magic_setregexp, 0, 0, 0, 0, 0, 0 },
{ Perl_magic_getuvar, Perl_magic_setuvar, 0, 0, 0, 0, 0, 0 },
{ Perl_magic_getdefelem, Perl_magic_setdefelem, 0, 0, 0, 0, 0, 0 },
{ 0, Perl_magic_setregexp, 0, 0, 0, 0, 0, 0 },
@@ -106,6 +102,9 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = {
EXT_MGVTBL PL_magic_vtables[magic_vtable_max];
#endif
+#define want_vtbl_bm want_vtbl_regexp
+#define want_vtbl_fm want_vtbl_regexp
+
#define PL_vtbl_amagic PL_magic_vtables[want_vtbl_amagic]
#define PL_vtbl_amagicelem PL_magic_vtables[want_vtbl_amagicelem]
#define PL_vtbl_arylen PL_magic_vtables[want_vtbl_arylen]
diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
index 3419070484..20ba5778bb 100644
--- a/regen/mg_vtable.pl
+++ b/regen/mg_vtable.pl
@@ -39,11 +39,9 @@ my @sig =
'substr' => {get => 'getsubstr', set => 'setsubstr'},
'vec' => {get => 'getvec', set => 'setvec'},
'pos' => {get => 'getpos', set => 'setpos'},
- 'bm' => {set => 'setregexp'},
- 'fm' => {set => 'setregexp'},
'uvar' => {get => 'getuvar', set => 'setuvar'},
'defelem' => {get => 'getdefelem', set => 'setdefelem'},
- 'regexp' => {set => 'setregexp'},
+ 'regexp' => {set => 'setregexp', alias => [qw(bm fm)]},
'regdata' => {len => 'regdata_cnt'},
'regdatum' => {get => 'regdatum_get', set => 'regdatum_set'},
'amagic' => {set => 'setamagic', free => 'setamagic'},
@@ -96,6 +94,7 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = {
EOH
my @vtable_names;
+my @aliases;
while (my ($name, $data) = splice @sig, 0, 2) {
push @vtable_names, $name;
@@ -116,6 +115,10 @@ while (my ($name, $data) = splice @sig, 0, 2) {
{ 0, 0, 0, 0, 0, 0, 0, 0 }$comma
#endif
EOH
+ foreach(@{$data->{alias}}) {
+ push @aliases, "#define want_vtbl_$_ want_vtbl_$name\n";
+ push @vtable_names, $_;
+ }
}
print $h <<'EOH';
@@ -126,6 +129,7 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max];
EOH
+print $h @aliases, "\n";;
print $h "#define PL_vtbl_$_ PL_magic_vtables[want_vtbl_$_]\n"
foreach sort @vtable_names;