From ac0694db93e562b6cf448185acf698c149210824 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 31 Aug 2005 17:24:03 +0000 Subject: [PATCH] INT_TO_PTR() and PTR_TO_INT() macros added [r6551] --- ir/common/irtools.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ir/common/irtools.h b/ir/common/irtools.h index 279ab8f89..660b83ea6 100644 --- a/ir/common/irtools.h +++ b/ir/common/irtools.h @@ -14,6 +14,16 @@ #include "irnode.h" +/** + * convert an integer into pointer + */ +#define INT_TO_PTR(v) ((void *)((char *)0 + (v))) + +/** + * convert a pointer into an integer + */ +#define PTR_TO_INT(v) ((int)((char *)(v) - (char *)0)) + /** * The famous clear_link() walker-function. * Do not implement it by yourself, use this one -- 2.20.1