X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbepeephole.h;h=def4b8ed19dae9f791d1ed3adb8802f624d8262b;hb=d300330b1e6df8c8914b8fb70cf38ee1c8ca2634;hp=86fe44f129673499b425ab23d5a4f3a883f72aee;hpb=b70b1794d3fe3c289fd988aacbb567761186cd16;p=libfirm diff --git a/ir/be/bepeephole.h b/ir/be/bepeephole.h index 86fe44f12..def4b8ed1 100644 --- a/ir/be/bepeephole.h +++ b/ir/be/bepeephole.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -47,10 +47,21 @@ static INLINE ir_node *be_peephole_get_reg_value(const arch_register_t *reg) } /** - * Datatype of the generic op handler for optimisation. If it exchanged node - * with something else, then it must return the new node, otherwise NULL. + * Datatype of the generic op handler for optimisation. */ -typedef ir_node*(*peephole_opt_func) (ir_node *node); +typedef void (*peephole_opt_func) (ir_node *node); + +/** + * must be called from peephole optimisations before a node is exchanged, + * so bepeephole can update it's internal state. + */ +void be_peephole_before_exchange(const ir_node *old_node, ir_node *new_node); + +/** + * must be called from peephole optimisations after a node is exchanged, + * so bepeephole can update it's internal state. + */ +void be_peephole_after_exchange(ir_node *new_node); /** * Do peephole optimisations. It traverses the schedule of all blocks in