/*
- * Copyright (C) 1995-2007 Inria Rhone-Alpes. All right reserved.
- *
* This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 Inria Rhone-Alpes.
*/
/**
- * @file irlivechk.h
+ * @file
* @author Sebastian Hack
* @date 22.04.2007
* @brief
#include "irgraph.h"
#include "irnode.h"
+#include <stdbool.h>
typedef enum {
lv_chk_state_in = 1,
typedef struct lv_chk_t lv_chk_t;
+/**
+ * Filter out some nodes for which we never need liveness.
+ *
+ * @param irn the node t check
+ * @return 0 if no liveness info is needed, 1 else
+ */
+static inline bool is_liveness_node(const ir_node *irn)
+{
+ switch (get_irn_opcode(irn)) {
+ case iro_Block:
+ case iro_Bad:
+ case iro_End:
+ case iro_Anchor:
+ case iro_NoMem:
+ return 0;
+ default:
+ return 1;
+ }
+}
+
/**
* Make a new liveness check environment.
* @param irg The graph.