From c4f6f664340b3d15b89cdbaa8f2c03d166b81782 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Tue, 14 Jun 2005 14:11:54 +0000 Subject: [PATCH] Added classify wrapper function. --- ir/be/bearch.c | 6 ++++++ ir/be/bearch.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ir/be/bearch.c b/ir/be/bearch.c index ac105f3d6..137f852e0 100644 --- a/ir/be/bearch.c +++ b/ir/be/bearch.c @@ -149,3 +149,9 @@ extern void arch_set_irn_register(const arch_env_t *env, assert(idx >= 0); ops->set_irn_reg(ops, irn, idx, reg); } + +extern arch_irn_class_t arch_irn_classify(const arch_env_t *env, const ir_node *irn) +{ + const arch_irn_ops_t *ops = get_irn_ops(env, irn); + return ops->classify(ops, irn); +} diff --git a/ir/be/bearch.h b/ir/be/bearch.h index 02c0cf110..a6e5845b6 100644 --- a/ir/be/bearch.h +++ b/ir/be/bearch.h @@ -392,6 +392,14 @@ arch_get_irn_register(const arch_env_t *env, const ir_node *irn, int idx); extern void arch_set_irn_register(const arch_env_t *env, ir_node *irn, int idx, const arch_register_t *reg); +/** + * Classify a node. + * @param env The architecture environment. + * @param irn The node. + * @return A classification of the node. + */ +extern arch_irn_class_t arch_irn_classify(const arch_env_t *env, const ir_node *irn); + #define arch_irn_has_reg_class(env, irn, pos, cls) \ ((cls) == arch_get_irn_reg_class(env, irn, pos)) -- 2.20.1