Front page | perl.perl5.porters |
Postings from July 2014
irregularly named data symbols
Thread Next
From:
Jarkko Hietaniemi
Date:
July 2, 2014 13:05
Subject:
irregularly named data symbols
Message ID:
53B403A5.4000000@iki.fi
While working on the libperl.t I was stupidly ambitious at first and
played with checking all the data symbols, but the list of exceptions
grew a little bit too long.
I'm not saying that all of these need to
be "fixed" but maybe *some* more order could be brought into this...
So here are the discarded bits of libperl.t which map the data symbol
exceptions from the Big Rule (globals have PL_ and live in globals.o):
(a fun fact: "zero_but_true" lives in pp_sys.o -- okay, maybe not *that*
fun...)
The $GSP symbol in the below comes from libperl.t and indicates the
PERL_GLOBAL_STRUCT_PRIVATE option being on.
+# These are exceptions in the senses that:
+# - PL_ data symbol but not in globals.o
+# - PerlIO data symbol but not in perlio.o
+# - data symbol not prefixed by PL_ or PerlIO
+#
+# XXX Some of these irregularities should probably be fixed/regularized:
+# - moved to globals.c (if used by many)
+# - moved as function local static const (if use only by that function)
+# - renamed with a prefix (underscore? a new one for file statics?)
+# - renamed with a the globals prefix (PL_)
+# - while at it, check that any of these that can be consted, are consted
+my %DATA_EXCEPTIONS_BY_OBJECT = (
+ 'dump.o' =>
+ [qw(
+ cv_flags_name
+ cv_flags_names
+ first_sv_flags_names
+ gp_flags_imported_names
+ gp_flags_names
+ hv_flags_names
+ magic_names
+ op_const_names
+ op_dbstate_names
+ op_delete_names
+ op_die_names
+ op_entersub_names
+ op_exists_names
+ op_flags_names
+ op_flip_names
+ op_gv_names
+ op_leave_names
+ op_leavesub_names
+ op_list_names
+ op_open_names
+ op_private_names
+ op_repeat_names
+ op_reverse_names
+ op_rv2cv_names
+ op_sassign_names
+ op_sort_names
+ op_split_names
+ op_trans_names
+ pmflags_flags_names
+ regexp_core_extflags_names
+ regexp_core_intflags_names
+ regexp_extflags_names
+ second_sv_flags_names
+ svshorttypenames
+ svtypenames
+ )],
+ 'gv.o' =>
+ [qw(
+ PL_AMG_namelens
+ PL_AMG_names
+ S_autoload
+ )],
+ 'hv.o' =>
+ [qw(
+ S_strtab_error
+ )],
+ 'mro.o' =>
+ [qw(
+ dfs_alg
+ )],
+ 'perl.o' =>
+ [qw(
+ ASCII_invlist
+ Cased_invlist
+ VertSpace_invlist
+ XPerlSpace_invlist
+ XPosixAlnum_invlist
+ XPosixAlpha_invlist
+ XPosixBlank_invlist
+ XPosixCntrl_invlist
+ XPosixDigit_invlist
+ XPosixGraph_invlist
+ XPosixLower_invlist
+ XPosixPrint_invlist
+ XPosixPunct_invlist
+ XPosixSpace_invlist
+ XPosixUpper_invlist
+ XPosixWord_invlist
+ PosixXDigit_invlist
+ XPosixXDigit_invlist
+ local_patches
+ )],
+ 'perly.o' =>
+ [qw(
+ yy_type_tab
+ yycheck
+ yydefact
+ yydefgoto
+ yypact
+ yypgoto
+ yyr1
+ yyr2
+ yystos
+ yytable
+ yytranslate
+ )],
+ 'pp.o' =>
+ [qw(
+ S_no_symref_sv
+ )],
+ 'pp_ctl.o' =>
+ [qw(
+ context_name
+ )],
+ 'pp_pack.o' =>
+ [qw(
+ packprops
+ symbol_packprops
+ )],
+ 'pp_sys.o' =>
+ [qw(
+ days_in_month
+ julian_days_by_month
+ length_of_year
+ safe_years
+ zero_but_true
+ )],
+ 'regcomp.o' =>
+ [qw(
+ _Perl_Any_Folds_invlist
+ _Perl_Folds_To_Multi_Char_invlist
+ AboveLatin1_invlist
+ Latin1_invlist
+ NonL1_Perl_Non_Final_Folds_invlist
+ UpperLatin1_invlist
+ PL_core_reg_engine
+ PL_reg_extflags_name
+ PL_reg_intflags_name
+ PL_reg_name
+ PL_regkind
+ PL_simple
+ PL_simple_bitmask
+ PL_varies
+ PL_varies_bitmask
+ reg_off_by_arg
+ regarglen
+ )],
+ 'sv.o' =>
+ [qw(
+ bodies_by_type
+ fake_rv
+ )],
+ 'universal.o' =>
+ [qw(
+ details
+ )],
+ 'utf8.o' =>
+ [qw(
+ _Perl_IDCont_invlist
+ _Perl_IDStart_invlist
+ swash_property_names
+ unees
+ )],
+);
+
+if ($DEBUGGING) {
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'deb.o'}}, 'si_names';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'perly.o'}}, 'yyprhs';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'perly.o'}}, 'yyrhs';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'perly.o'}}, 'yyrline';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'perly.o'}}, 'yytname';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'sv.o'}}, 'debug_tokens';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'toke.o'}}, 'exp_name';
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'toke.o'}}, 'lex_state_names';
+ unless ($GSP) {
+ push @{$DATA_EXCEPTIONS_BY_OBJECT{'sv.o'}}, 'done_sanity_check';
+ }
+}
Thread Next
-
irregularly named data symbols
by Jarkko Hietaniemi