X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibfirm%2Fvrp.h;h=9a58baebc374c9ea1490ad20018f27755da21d1d;hb=6f068af98daa4725d60e5d23a8f98ec2841cfa44;hp=78dbec24fe05d06d601d3c91f90d8329fd3cf980;hpb=7c63b4d0d2dbedf66cc29bac75c32041da03ba7b;p=libfirm diff --git a/include/libfirm/vrp.h b/include/libfirm/vrp.h index 78dbec24f..9a58baebc 100644 --- a/include/libfirm/vrp.h +++ b/include/libfirm/vrp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2009 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -24,63 +24,46 @@ * @version $Id$ * */ -#include "firm_types.h" - #ifndef VRP_H #define VRP_H -enum range_types { - VRP_UNDEFINED, /* No information could be derived so far */ - VRP_RANGE, /* bottom and top form a range, including both values */ - VRP_ANTIRANGE, /* range from bottom to top can not be, but borders might - be */ - VRP_VARYING /* information can not be derived */ -}; +#include "firm_types.h" +#include "begin.h" -enum range_ops { - VRP_NONE, /* range is defined absolute */ - VRP_ADD, /* range + range_node are the possible values */ - VRP_SUB /* range - range_node are the possible values */ +enum range_types { + VRP_UNDEFINED, /**< No information could be derived so far */ + VRP_RANGE, /**< bottom and top form a range, including both values */ + VRP_ANTIRANGE, /**< range from bottom to top cannot be, but borders might + be */ + VRP_VARYING /**< information cannot be derived */ }; /** VRP information */ typedef struct { - int valid; /**< This node has valid vrp information */ - tarval *bits_set; /**< The bits which, by analysis, are definitely set. - 0: may be not set, 1: definitely set*/ - tarval *bits_not_set; /**< The bits which by analysis are definitely - not set, 1 for may be set, 0: definitely not set */ - ir_node *bits_node; /**< The node, from which the rest of the bits - are set */ - enum range_types range_type;/**< The range represented by range_top, range_bottom */ - tarval *range_bottom, *range_top; - ir_node *range_node; /**< The node to which the range is relative */ - enum range_ops range_op; /**< The op which describes the relation - between range_node and range */ + int valid; /**< This node has valid vrp information */ + ir_tarval *bits_set; /**< The bits which, by analysis, are definitely set. + 0: may be not set, 1: definitely set*/ + ir_tarval *bits_not_set; /**< The bits which by analysis are definitely + not set, 1 for may be set, 0: definitely not set */ + enum range_types range_type; /**< The range represented by range_top, range_bottom */ + ir_tarval *range_bottom; + ir_tarval *range_top; } vrp_attr; /** * Set vrp data on the graph irg * @param irg graph on which to set vrp data */ -void set_vrp_data(ir_graph *irg); - -/** - * Creates an ir_prog_pass for vrp - * - * @param name the name of this pass or NULL - */ -ir_graph_pass_t *set_vrp_pass(const char *name); +FIRM_API void set_vrp_data(ir_graph *irg); /** * Test, if the two nodes can be compared with their vrp information * * @param left: the left node * @param right: the right node - * - * @return the pn_Cmp, if one can be derived + * @return all possible relations */ -pn_Cmp vrp_cmp(const ir_node *left, const ir_node *right); +FIRM_API ir_relation vrp_cmp(const ir_node *left, const ir_node *right); /* * Return the vrp data for this node @@ -89,6 +72,8 @@ pn_Cmp vrp_cmp(const ir_node *left, const ir_node *right); * * @return a pointer to the vrp data or NULL if there is none */ -vrp_attr *vrp_get_info(const ir_node *n); +FIRM_API vrp_attr *vrp_get_info(const ir_node *n); + +#include "end.h" #endif