07 May 2019 12:10:41 UTC
- Distribution: B-C
- Module version: 1.12_01
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (76)
- Testers (91 / 247 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Activity24 month
- Download (2.04MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
B::Stackobj - Stack and type annotation helper module for the CC backend
A simple representation of pp stacks and lexical pads for the B::CC compiler. All locals and function arguments get type annotated, for all B::CC ops which can be optimized.
For lexical pads (i.e. my or better our variables) we currently can force the type of variables according to a magic naming scheme in "load_pad" in B::CC.
my $<name>_i; IV integer my $<name>_ir; IV integer in a pseudo register my $<name>_d; NV double
Future ideas are type qualifiers as attributes
B<num>, B<int>, B<register>, B<temp>, B<unsigned>, B<ro>
such as in
our int $i : unsigned : ro; our num $d;
Type attributes for sub definitions are not spec'ed yet. Ctypes attributes and objects should also be recognized, such as
my vs our: Note that only our attributes are resolved at compile-time, my attributes are resolved at run-time. So the compiler will only see type attributes for our variables.
TODO: Represent on this stack not only PADs,SV,IV,PV,NV,BOOL,Special and a SV const, but also GV,CV,RV,AV,HV, esp. AELEM and HELEM. Use B::Stackobj::Const.
MICB at cpan.org(retired), Reini Urban
rurban at cpan.org