aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.h
diff options
Diffstat (limited to 'linearize.h')
-rw-r--r--linearize.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/linearize.h b/linearize.h
index d4973677..89da3db6 100644
--- a/linearize.h
+++ b/linearize.h
@@ -175,6 +175,14 @@ struct basic_block {
};
+//
+// return the opcode of the instruction defining ``SRC`` if existing
+// and OP_BADOP if not. It also assigns the defining instruction
+// to ``DEF``.
+#define DEF_OPCODE(DEF, SRC) \
+ (((SRC)->type == PSEUDO_REG && (DEF = (SRC)->def)) ? DEF->opcode : OP_BADOP)
+
+
static inline void add_bb(struct basic_block_list **list, struct basic_block *bb)
{
add_ptr_list(list, bb);