| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "B::Op_private 3perl" |
| 58 |
.TH B::Op_private 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
B::Op_private \- OP op_private flag definitions |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 1 |
| 68 |
\& use B::Op_private; |
| 69 |
\& |
| 70 |
\& # flag details for bit 7 of OP_AELEM\*(Aqs op_private: |
| 71 |
\& my $name = $B::Op_private::bits{aelem}{7}; # OPpLVAL_INTRO |
| 72 |
\& my $value = $B::Op_private::defines{$name}; # 128 |
| 73 |
\& my $label = $B::Op_private::labels{$name}; # LVINTRO |
| 74 |
\& |
| 75 |
\& # the bit field at bits 5..6 of OP_AELEM\*(Aqs op_private: |
| 76 |
\& my $bf = $B::Op_private::bits{aelem}{6}; |
| 77 |
\& my $mask = $bf\->{bitmask}; # etc |
| 78 |
.Ve |
| 79 |
.SH DESCRIPTION |
| 80 |
.IX Header "DESCRIPTION" |
| 81 |
This module provides four global hashes: |
| 82 |
.PP |
| 83 |
.Vb 4 |
| 84 |
\& %B::Op_private::bits |
| 85 |
\& %B::Op_private::defines |
| 86 |
\& %B::Op_private::labels |
| 87 |
\& %B::Op_private::ops_using |
| 88 |
.Ve |
| 89 |
.PP |
| 90 |
which contain information about the per-op meanings of the bits in the |
| 91 |
op_private field. |
| 92 |
.ie n .SS %bits |
| 93 |
.el .SS \f(CW%bits\fP |
| 94 |
.IX Subsection "%bits" |
| 95 |
This is indexed by op name and then bit number (0..7). For single bit flags, |
| 96 |
it returns the name of the define (if any) for that bit: |
| 97 |
.PP |
| 98 |
.Vb 1 |
| 99 |
\& $B::Op_private::bits{aelem}{7} eq \*(AqOPpLVAL_INTRO\*(Aq; |
| 100 |
.Ve |
| 101 |
.PP |
| 102 |
For bit fields, it returns a hash ref containing details about the field. |
| 103 |
The same reference will be returned for all bit positions that make |
| 104 |
up the bit field; so for example these both return the same hash ref: |
| 105 |
.PP |
| 106 |
.Vb 2 |
| 107 |
\& $bitfield = $B::Op_private::bits{aelem}{5}; |
| 108 |
\& $bitfield = $B::Op_private::bits{aelem}{6}; |
| 109 |
.Ve |
| 110 |
.PP |
| 111 |
The general format of this hash ref is |
| 112 |
.PP |
| 113 |
.Vb 5 |
| 114 |
\& { |
| 115 |
\& # The bit range and mask; these are always present. |
| 116 |
\& bitmin => 5, |
| 117 |
\& bitmax => 6, |
| 118 |
\& bitmask => 0x60, |
| 119 |
\& |
| 120 |
\& # (The remaining keys are optional) |
| 121 |
\& |
| 122 |
\& # The names of any defines that were requested: |
| 123 |
\& mask_def => \*(AqOPpFOO_MASK\*(Aq, |
| 124 |
\& baseshift_def => \*(AqOPpFOO_SHIFT\*(Aq, |
| 125 |
\& bitcount_def => \*(AqOPpFOO_BITS\*(Aq, |
| 126 |
\& |
| 127 |
\& # If present, Concise etc will display the value with a \*(AqFOO=\*(Aq |
| 128 |
\& # prefix. If it equals \*(Aq\-\*(Aq, then Concise will treat the bit |
| 129 |
\& # field as raw bits and not try to interpret it. |
| 130 |
\& label => \*(AqFOO\*(Aq, |
| 131 |
\& |
| 132 |
\& # If present, specifies the names of some defines and the |
| 133 |
\& # display labels that are used to assign meaning to particu\- |
| 134 |
\& # lar integer values within the bit field; e.g. 3 is dis\- |
| 135 |
\& # played as \*(AqC\*(Aq. |
| 136 |
\& enum => [ qw( |
| 137 |
\& 1 OPpFOO_A A |
| 138 |
\& 2 OPpFOO_B B |
| 139 |
\& 3 OPpFOO_C C |
| 140 |
\& )], |
| 141 |
\& |
| 142 |
\& }; |
| 143 |
.Ve |
| 144 |
.ie n .SS %defines |
| 145 |
.el .SS \f(CW%defines\fP |
| 146 |
.IX Subsection "%defines" |
| 147 |
This gives the value of every \f(CW\*(C`OPp\*(C'\fR define, e.g. |
| 148 |
.PP |
| 149 |
.Vb 1 |
| 150 |
\& $B::Op_private::defines{OPpLVAL_INTRO} == 128; |
| 151 |
.Ve |
| 152 |
.ie n .SS %labels |
| 153 |
.el .SS \f(CW%labels\fP |
| 154 |
.IX Subsection "%labels" |
| 155 |
This gives the short display label for each define, as used by \f(CW\*(C`B::Concise\*(C'\fR |
| 156 |
and \f(CW\*(C`perl \-Dx\*(C'\fR, e.g. |
| 157 |
.PP |
| 158 |
.Vb 1 |
| 159 |
\& $B::Op_private::labels{OPpLVAL_INTRO} eq \*(AqLVINTRO\*(Aq; |
| 160 |
.Ve |
| 161 |
.PP |
| 162 |
If the label equals '\-', then Concise will treat the bit as a raw bit and |
| 163 |
not try to display it symbolically. |
| 164 |
.ie n .SS %ops_using |
| 165 |
.el .SS \f(CW%ops_using\fP |
| 166 |
.IX Subsection "%ops_using" |
| 167 |
For each define, this gives a reference to an array of op names that use |
| 168 |
the flag. |
| 169 |
.PP |
| 170 |
.Vb 1 |
| 171 |
\& @ops_using_lvintro = @{ $B::Op_private::ops_using{OPp_LVAL_INTRO} }; |
| 172 |
.Ve |