/*
- * 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.
*
* @version $Id$
*
*/
-#include "firm_types.h"
-
#ifndef VRP_H
#define VRP_H
+#include "firm_types.h"
+#include "begin.h"
+
enum range_types {
- VRP_UNDEFINED,
- VRP_RANGE,
- VRP_ANTIRANGE,
- VRP_VARYING
+ 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 */
};
-enum range_ops {
- VRP_NONE,
- VRP_ADD,
- VRP_SUB
-};
+/** VRP information */
+typedef struct {
+ 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 all possible relations
+ */
+FIRM_API ir_relation vrp_cmp(const ir_node *left, const ir_node *right);
+
+/*
+ * Return the vrp data for this node
+ *
+ * @param n: the node for which to return the vrp information
*
- * @return the pn_Cmp, if one can be derived
+ * @return a pointer to the vrp data or NULL if there is none
*/
-pn_Cmp vrp_cmp(ir_node *left, ir_node *right);
+FIRM_API vrp_attr *vrp_get_info(const ir_node *n);
+
+#include "end.h"
#endif