libFirm
irpass.h File Reference

Manager for transformation passes. More...

#include "firm_types.h"
#include "begin.h"
#include "end.h"

Go to the source code of this file.

Functions

ir_graph_pass_manager_tnew_graph_pass_mgr (const char *name, int verify_all, int dump_all)
 Creates a new ir_graph pass manager.
void ir_graph_pass_mgr_add (ir_graph_pass_manager_t *mgr, ir_graph_pass_t *pass)
 Adds an ir_graph pass to a graph pass manager.
int ir_graph_pass_mgr_run (ir_graph_pass_manager_t *mgr)
 Runs all passes of an ir_graph pass manager.
void term_graph_pass_mgr (ir_graph_pass_manager_t *mgr)
 Terminates an ir_graph pass manager and all owned passes.
ir_prog_pass_manager_tnew_prog_pass_mgr (const char *name, int verify_all, int dump_all)
 Creates a new ir_prog pass manager.
void ir_prog_pass_mgr_add (ir_prog_pass_manager_t *mgr, ir_prog_pass_t *pass)
 Adds an ir_prog pass to an ir_prog pass manager.
void ir_prog_pass_mgr_add_graph_mgr (ir_prog_pass_manager_t *mgr, ir_graph_pass_manager_t *graph_mgr)
 Adds an ir_graph_pass_manager as a pass to an ir_prog pass manager.
void ir_prog_pass_mgr_add_graph_pass (ir_prog_pass_manager_t *mgr, ir_graph_pass_t *pass)
 Adds an ir_graph_pass as a pass to an ir_prog pass manager.
int ir_prog_pass_mgr_run (ir_prog_pass_manager_t *mgr)
 Runs all passes of an ir_prog pass manager.
void term_prog_pass_mgr (ir_prog_pass_manager_t *mgr)
 Terminates an ir_prog pass manager and all owned passes.
void ir_graph_pass_mgr_set_run_idx (ir_graph_pass_manager_t *mgr, unsigned run_idx)
 Sets the run index for an irgraph pass manager.
ir_graph_pass_tdef_graph_pass (const char *name, void(*function)(ir_graph *irg))
 Creates an ir_graph pass for running void function(ir_graph *irg).
ir_graph_pass_tdef_graph_pass_ret (const char *name, int(*function)(ir_graph *irg))
 Creates an ir_graph pass for running int function(ir_graph *irg).
ir_graph_pass_tdef_graph_pass_constructor (ir_graph_pass_t *memory, const char *name, int(*function)(ir_graph *irg, void *context))
 Creates an ir_graph pass for running int function(ir_graph *irg).
void ir_graph_pass_set_parallel (ir_graph_pass_t *pass, int flag)
 Sets the run_parallel property of a graph pass.
ir_prog_pass_tdef_prog_pass (const char *name, void(*function)(void))
 Creates an ir_prog pass for running void function().
ir_prog_pass_tdef_prog_pass_constructor (ir_prog_pass_t *memory, const char *name, int(*function)(ir_prog *irp, void *context))
 Creates an ir_prog pass for running void function().
ir_prog_pass_tcall_function_pass (const char *name, void(*function)(void *context), void *context)
 Creates a pass that calls some function.
void ir_prog_pass_mgr_set_run_idx (ir_prog_pass_manager_t *mgr, unsigned run_idx)
 Sets the run index for an irprog pass manager.

Detailed Description

Manager for transformation passes.

Author
Michael Beck

Definition in file irpass.h.

Function Documentation

ir_prog_pass_t* call_function_pass ( const char *  name,
void(*)(void *context)  function,
void *  context 
)

Creates a pass that calls some function.

This pass calls the given function, but has no dump nor verify.

Parameters
namethe name of this pass
functionthe function to run
contextcontext parameter
Returns
the newly created ir_prog pass
ir_graph_pass_t* def_graph_pass ( const char *  name,
void(*)(ir_graph *irg)  function 
)

Creates an ir_graph pass for running void function(ir_graph *irg).

Uses the default verifier and dumper. The pass returns always 0.

Parameters
namethe name of this pass
functionthe function to run
Returns
the newly created ir_graph pass
ir_graph_pass_t* def_graph_pass_constructor ( ir_graph_pass_t memory,
const char *  name,
int(*)(ir_graph *irg, void *context)  function 
)

Creates an ir_graph pass for running int function(ir_graph *irg).

Uses the default verifier and dumper. The pass returns the return value of function.

Parameters
memoryif non-NULL, an already allocated ir_graph_pass_t
namethe name of this pass
functionthe function to run
Returns
the newly created ir_graph pass
ir_graph_pass_t* def_graph_pass_ret ( const char *  name,
int(*)(ir_graph *irg)  function 
)

Creates an ir_graph pass for running int function(ir_graph *irg).

Uses the default verifier and dumper. The pass returns the return value of function.

Parameters
namethe name of this pass
functionthe function to run
Returns
the newly created ir_graph pass
ir_prog_pass_t* def_prog_pass ( const char *  name,
void(*)(void)  function 
)

Creates an ir_prog pass for running void function().

Uses the default verifier and dumper. The pass returns always 0.

Parameters
namethe name of this pass
functionthe function to run
Returns
the newly created ir_graph pass
ir_prog_pass_t* def_prog_pass_constructor ( ir_prog_pass_t memory,
const char *  name,
int(*)(ir_prog *irp, void *context)  function 
)

Creates an ir_prog pass for running void function().

Uses the default verifier and dumper. The pass returns always 0.

Parameters
memoryif non-NULL, an already allocated ir_prog_pass_t
namethe name of this pass
functionthe function to run
Returns
the newly created ir_prog pass
void ir_graph_pass_mgr_add ( ir_graph_pass_manager_t mgr,
ir_graph_pass_t pass 
)

Adds an ir_graph pass to a graph pass manager.

Parameters
mgrthe ir_graph pass manager
passthe pass to add
int ir_graph_pass_mgr_run ( ir_graph_pass_manager_t mgr)

Runs all passes of an ir_graph pass manager.

Parameters
mgrthe manager
Returns
0 if all passes return 0, else 1
void ir_graph_pass_mgr_set_run_idx ( ir_graph_pass_manager_t mgr,
unsigned  run_idx 
)

Sets the run index for an irgraph pass manager.

Parameters
mgrthe manager
run_idxthe index for the first pass of this manager
void ir_graph_pass_set_parallel ( ir_graph_pass_t pass,
int  flag 
)

Sets the run_parallel property of a graph pass.

If the flag is set to non-zero, the pass can be executed parallel on all graphs of a ir_prog.

Parameters
passthe pass
flagnew flag setting
void ir_prog_pass_mgr_add ( ir_prog_pass_manager_t mgr,
ir_prog_pass_t pass 
)

Adds an ir_prog pass to an ir_prog pass manager.

Parameters
mgrthe ir_prog pass manager
passthe pass to add
void ir_prog_pass_mgr_add_graph_mgr ( ir_prog_pass_manager_t mgr,
ir_graph_pass_manager_t graph_mgr 
)

Adds an ir_graph_pass_manager as a pass to an ir_prog pass manager.

Parameters
mgrthe ir_prog pass manager
graph_mgrthe ir_graph pass manager to be added
void ir_prog_pass_mgr_add_graph_pass ( ir_prog_pass_manager_t mgr,
ir_graph_pass_t pass 
)

Adds an ir_graph_pass as a pass to an ir_prog pass manager.

Parameters
mgrthe ir_prog pass manager
passthe ir_graph pass to be added
int ir_prog_pass_mgr_run ( ir_prog_pass_manager_t mgr)

Runs all passes of an ir_prog pass manager.

Parameters
mgrthe manager
Returns
0 if all passes return 0, else 1
void ir_prog_pass_mgr_set_run_idx ( ir_prog_pass_manager_t mgr,
unsigned  run_idx 
)

Sets the run index for an irprog pass manager.

Parameters
mgrthe manager
run_idxthe index for the first pass of this manager
ir_graph_pass_manager_t* new_graph_pass_mgr ( const char *  name,
int  verify_all,
int  dump_all 
)

Creates a new ir_graph pass manager.

Parameters
namethe name of the manager
verify_allif non-zero, all passes of this manager will be verified
dump_allif non-zero, all passes results will be dumped
Returns
the newly created manager
ir_prog_pass_manager_t* new_prog_pass_mgr ( const char *  name,
int  verify_all,
int  dump_all 
)

Creates a new ir_prog pass manager.

Parameters
namethe name of the manager
verify_allif non-zero, all passes of this manager will be verified
dump_allif non-zero, all passes results will be dumped
Returns
the newly created manager
void term_graph_pass_mgr ( ir_graph_pass_manager_t mgr)

Terminates an ir_graph pass manager and all owned passes.

Parameters
mgrthe manager
void term_prog_pass_mgr ( ir_prog_pass_manager_t mgr)

Terminates an ir_prog pass manager and all owned passes.

Parameters
mgrthe manager