PreviousUpNext

15.4.436  src/lib/compiler/back/low/treecode/instruction-sequence-generator-g.pkg

## instruction-sequence-generator-g.pkg

# Compiled by:
#     src/lib/compiler/back/low/lib/treecode.lib

# Generate a linear sequence of instructions



###               "One has to look out for engineers --
###                they begin with sewing machines
###                and end up with the atomic bomb."
###
###                                 -- Marcel Pagnol



stipulate
    package lem =  lowhalf_error_message;                                       # lowhalf_error_message                 is from   src/lib/compiler/back/low/control/lowhalf-error-message.pkg
herein

# We are nowhere invoked:

    generic package   linear_instruction_sequence_generator_g   (
        #             =======================================
        #
        package mcf: Machcode_Form;                                             # Machcode_Form                         is from   src/lib/compiler/back/low/code/machcode-form.api

        package cst: Codebuffer;                                                # Codebuffer                            is from   src/lib/compiler/back/low/code/codebuffer.api

        package mcg: Machcode_Controlflow_Graph                                 # Machcode_Controlflow_Graph            is from   src/lib/compiler/back/low/mcg/machcode-controlflow-graph.api
                     where
                          mcf == mcf                                            # "mcf" == "machcode_form" (abstract machine code).
                     also pop == cst::pop;                                      # "pop" == "pseudo_op".
    )
    : (weak) Instruction_Sequence_Generator                                     # Instruction_Sequence_Generator        is from   src/lib/compiler/back/low/treecode/instruction-sequence-generator.api
    {
        # Export to client packages:
        #
        package mcg = mcg;                                                      # "mcg" == "machcode_controlflow_graph".
        package mcf = mcf;                                                      # "mcf" == "machcode_form" (abstract machine code).
        package rgk = mcf::rgk;                                                 # "rgk" == "registerkinds".
        package cst = cst;


        #  Pretty stupid, eh? 
        #
        fun new_stream  ops                                             # FUCKING STUPID, YES. This is the opposite of typesafe programming. Define and use a separate API if you're not going to implement the stream api. XXX SUCKO FIXME.
            =
            {
              start_new_cccomponent       => can't_use,
              get_completed_cccomponent         => can't_use,
              put_op,
              put_pseudo_op      => can't_use,
              put_private_label  => can't_use,
              put_public_label => can't_use,
              put_comment        => can't_use,
              put_bblock_note     => can't_use,
              get_notes           => can't_use,
              put_fn_liveout_info       => can't_use
            }
            where 
                fun put_op  op
                    =
                    ops :=   op ! *ops; 

                fun can't_use _
                    =
                    lem::error("linear_instruction_sequence_generator_g", "unimplemented");
            end; 
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext