X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fcdep.h;h=58e5d3f6915cdd58b1c3563de9e1789486fbb318;hb=6f068af98daa4725d60e5d23a8f98ec2841cfa44;hp=102efc4514dde7892b1c028863bf6d22bd3a0ad1;hpb=1ec30d95387eb392ba5a1adc7958ebd91383d59c;p=libfirm diff --git a/include/libfirm/cdep.h b/include/libfirm/cdep.h index 102efc451..58e5d3f69 100644 --- a/include/libfirm/cdep.h +++ b/include/libfirm/cdep.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. * @@ -20,33 +20,60 @@ /** * @file * @brief control dependence analysis - * @author Chrsitoph Mallon + * @author Christoph Mallon * @version $Id$ */ #ifndef FIRM_ANA_CDEP_H #define FIRM_ANA_CDEP_H #include "firm_types.h" - -typedef struct cdep cdep; -struct cdep { - ir_node *node; - cdep *next; -}; +#include "begin.h" /** Compute the control dependence graph for a graph. */ -void compute_cdep(ir_graph *irg); -void free_cdep(ir_graph *irg); +FIRM_API void compute_cdep(ir_graph *irg); + +/** Free the control dependence info. */ +FIRM_API void free_cdep(ir_graph *irg); + +/** Return control dependent block */ +FIRM_API ir_node *get_cdep_node(const ir_cdep *cdep); -cdep *find_cdep(const ir_node *block); +/** Get next entry in a list of cdeps */ +FIRM_API ir_cdep *get_cdep_next(const ir_cdep *cdep); + +/** + * Return a list of all control dependences of a block. + */ +FIRM_API ir_cdep *find_cdep(const ir_node *block); + +/** + * Replace the control dependence info of old by the info of nw. + */ +FIRM_API void exchange_cdep(ir_node *old, const ir_node *nw); -void exchange_cdep(ir_node *old, const ir_node *nw); +/** + * Check whether dependee is (directly) control dependent on candidate. + * + * @param dependee the (possible) dependent block + * @param candidate the (possible) block on which dependee is dependent + */ +FIRM_API int is_cdep_on(const ir_node *dependee, const ir_node *candidate); -int is_cdep_on(const ir_node *dependee, const ir_node *candidate); +/** + * If block is control dependent on exactly one node, return this node, + * else NULL. + * + * @param block the block to check + */ +FIRM_API ir_node *get_unique_cdep(const ir_node *block); -int is_iterated_cdep_on(ir_node *dependee, ir_node *candidate); +/** + * Check if the given block is control dependent of more than one node. + * + * @param block the block to check + */ +FIRM_API int has_multiple_cdep(const ir_node *block); -ir_node *get_unique_cdep(const ir_node *block); -int has_multiple_cdep(const ir_node *block); +#include "end.h" #endif