don't make -ddump-if-trace imply -no-recomp
[ghc-hetmet.git] / includes / Cmm.h
index 715d2b2..4cfb432 100644 (file)
 #endif
 
 /*
- * The RTS must UNTAG a pointer before dereferencing it.
- * The use of UNTAG follows the following rules of thumb:
- *
- * - Any pointer might be tagged.
- * - Except the pointers that are passed in R1 to RTS functions.
- * - R1 is also untagged when entering constructor code.
- * 
- * TODO:
- *
- * - Remove redundancies of tagging and untagging in code generation.
- * - Optimize getTag or dataToTag# ?
- *
+ * The RTS must sometimes UNTAG a pointer before dereferencing it.
+ * See the wiki page Commentary/Rts/HaskellExecution/PointerTagging 
  */
 #define TAG_MASK ((1 << TAG_BITS) - 1)
 #define UNTAG(p) (p & ~TAG_MASK)
 #define BITMAP_BITS(bitmap) ((bitmap) >> BITMAP_BITS_SHIFT)
 
 /* Debugging macros */
-#define LOOKS_LIKE_INFO_PTR(p)                         \
-   ((p) != NULL &&                                     \
-     (TO_W_(%INFO_TYPE(%STD_INFO(p))) != INVALID_OBJECT) &&    \
+#define LOOKS_LIKE_INFO_PTR(p)                                  \
+   ((p) != NULL &&                                              \
+    LOOKS_LIKE_INFO_PTR_NOT_NULL(p))
+
+#define LOOKS_LIKE_INFO_PTR_NOT_NULL(p)                         \
+   ( (TO_W_(%INFO_TYPE(%STD_INFO(p))) != INVALID_OBJECT) &&     \
      (TO_W_(%INFO_TYPE(%STD_INFO(p))) <  N_CLOSURE_TYPES))
 
 #define LOOKS_LIKE_CLOSURE_PTR(p) (LOOKS_LIKE_INFO_PTR(GET_INFO(UNTAG(p))))