GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
B::Bblock(3) User Contributed Perl Documentation B::Bblock(3)

B::Bblock - Walk basic blocks

  # External interface
  perl -MO=Bblock[,OPTIONS] foo.pl

    perl -MO=Bblock foo.pl     prints the basic block for main_root
    perl -MO=Bblock,foo::mysub foo.pm prints the basic block for &pkg::mysub
    perl -MO=Bblock,mysub foo.pm prints the basic block for &main::mysub

  # Programmatic API
  use B::Bblock qw(find_leaders);
  my $leaders = find_leaders($root_op, $start_op);

This module is used by the B::CC backend. It walks "basic blocks". A basic block is a series of operations which is known to execute from start to finish, with no possibility of branching or halting.

The block is the list of ops from the every leader up to the next. The leaders are the separator of each basic block.

The module can be used either stand alone or from inside another program. Standalone it just prints the basic blocks ops in B::Concise. terse format to STDOUT. Without options it starts at the main_root.

Basic block leaders are:

     Any COP (pp_nextstate) with a non-NULL label.
       [The op after a pp_enter] Omit
       [The op after a pp_entersub. Don't count this one.]
     The ops pointed at by nextop, redoop and lastop->op_next of a LOOP.
     The ops pointed at by op_next and op_other of a LOGOP, except
       for pp_entertry which has op_next and op_other->op_next
     The op pointed at by op_pmreplstart of a PMOP.
     The op pointed at by op_other->op_pmreplstart of pp_substcont?
       [The op after a pp_return] Omit

A comma-separated list of sub names to walk.

find_leaders
  my $leaders = find_leaders($root_op, $start_op);
    

Given the root of the op tree and an op from which to start processing, it will return a hash ref representing all the ops which start a block.

The values of %$leaders are the op objects themselves. Keys are $$op addresses.

Malcolm Beattie "MICB at cpan.org" (retired), Reini Urban "perl-compiler@googlegroups.com"
2018-11-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.