diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-09-27 17:25:24 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-09-27 17:29:06 +0100 |
commit | a4e744802906bbf8435494e7f5ab1823213b2448 (patch) | |
tree | d89130f4c2dc060155148af1c385d311e09cd4a1 /embed.pl | |
parent | 77d8c8d52bcb3950617cc1491f1f2713db7ea126 (diff) | |
download | perl-a4e744802906bbf8435494e7f5ab1823213b2448.tar.gz |
Move OP prototypes from pp_proto.h to proto.h
Make embed.pl fully responsible for generating prototypes and embedding macros
for pp_* and ck_* functions, placing them in embed.h and proto.h
opcode.pl no longer generates pp_proto.h
Remove the (effectively) duplicate explicit entries for (all but 2) ck_*
functions from embed.fnc
We can't actually remove pp_proto.h from the distribution *yet*, as
ExtUtils::MM_Unix and ExtUtils::MM_VMS have hardcoded lists of the installed
headers. Once this is resolved, we can.
Diffstat (limited to 'embed.pl')
-rwxr-xr-x | embed.pl | 62 |
1 files changed, 29 insertions, 33 deletions
@@ -119,6 +119,35 @@ while (<IN>) { push @embed, \@args; } +open IN, 'pp.sym' or die $!; +{ + my %syms; + + while (<IN>) { + s/[ \t]*#.*//; # Delete comments. + if (/^\s*(\S+)\s*$/) { + my $sym = $1; + warn "duplicate symbol $sym while processing 'pp.sym' line $.\n" + if $syms{$sym}++; + } + } + + foreach (sort keys %syms) { + s/^Perl_//; + if (/^ck_/) { + # These are all indirectly referenced by globals.c. + # This is somewhat annoying. + push @embed, ['pR', 'OP *', $_, 'NN OP *o']; + } + elsif (/^pp_/) { + push @embed, ['p', 'OP *', $_]; + } + else { + warn "Illegal symbol '$_' in pp.sym"; + } + } +} + # walk table providing an array of components in each line to # subroutine, printing the result sub walk_table (&@) { @@ -303,26 +332,6 @@ sub write_protos { warn "$unflagged_pointers pointer arguments to clean up\n" if $unflagged_pointers; walk_table(\&write_global_sym, "global.sym", "# ex: set ro:\n"); -sub readsyms (\%$) { - my ($syms, $file) = @_; - local (*FILE, $_); - open(FILE, "< $file") - or die "embed.pl: Can't open $file: $!\n"; - while (<FILE>) { - s/[ \t]*#.*//; # Delete comments. - if (/^\s*(\S+)\s*$/) { - my $sym = $1; - warn "duplicate symbol $sym while processing $file line $.\n" - if exists $$syms{$sym}; - $$syms{$sym} = 1; - } - } - close(FILE); -} - -# Perl_pp_* and Perl_ck_* are in pp.sym -readsyms my %ppsym, 'pp.sym'; - sub readvars(\%$$@) { my ($syms, $file,$pre,$keep_pre) = @_; local (*FILE, $_); @@ -474,19 +483,6 @@ if ($ifdef_state) { print $em "#endif\n"; } -for $sym (sort keys %ppsym) { - $sym =~ s/^Perl_//; - if ($sym =~ /^ck_/) { - print $em hide("$sym(a)", "Perl_$sym(aTHX_ a)"); - } - elsif ($sym =~ /^pp_/) { - print $em hide("$sym()", "Perl_$sym(aTHX)"); - } - else { - warn "Illegal symbol '$sym' in pp.sym"; - } -} - print $em <<'END'; #endif /* #ifndef PERL_NO_SHORT_NAMES */ |