[add flag to C types to say whether the garbage collector might be interested in them. add macros for getting at the 'what' field.
John Meacham <john@repetae.net>**20080310124540] hunk ./C/FromGrin2.hs 259
-    let tag = getWhat scrut
+    let tag = f_GETWHAT scrut
hunk ./C/FromGrin2.hs 294
-    let tag = getWhat scrut
+    let tag = f_GETWHAT scrut
hunk ./C/FromGrin2.hs 626
-        _ -> do return $ getWhat e =* constant (enum $ nodeTagName t)
+        _ -> do return . toStatement $ f_SETWHAT e (constant (enum $ nodeTagName t))
hunk ./C/FromGrin2.hs 726
+f_GETWHAT e   = functionCall (name "GETWHAT") [e]
+f_SETWHAT e v = functionCall (name "SETWHAT") [e,v]
hunk ./C/FromGrin2.hs 747
-sptr_t    = basicType "sptr_t"
-fptr_t    = basicType "fptr_t"
+sptr_t    = basicGCType "sptr_t"
+fptr_t    = basicGCType "fptr_t"
+wptr_t    = basicGCType "wptr_t"
hunk ./C/FromGrin2.hs 751
-wptr_t    = basicType "wptr_t"
hunk ./C/FromGrin2.hs 752
-tag_t     = basicType "tag_t"
hunk ./C/FromGrin2.hs 764
-getWhat :: Expression -> Expression
-getWhat e = project' (name "what") e
-
hunk ./C/Generate.hs 6
+    basicGCType,
hunk ./C/Generate.hs 136
-data Type = TB String | TPtr Type | TAnon [Type] | TNStruct Name | TFunPtr Type [Type]
+-- The Bool in TB and TPtr are whether the GC needs to consider the types to
+-- possibly contain garbage collectable pointers.
+data Type = TB String Bool | TPtr Type | TAnon [Type] | TNStruct Name | TFunPtr Type [Type]
hunk ./C/Generate.hs 205
-    draw (TB x) = text x
+    draw (TB x _) = text x
hunk ./C/Generate.hs 218
-    err s = TB $ terr s
+    err s = TB (terr s) False
hunk ./C/Generate.hs 468
-basicType s = TB s
+basicType s = TB s False
+
+-- | a basic type the garbage collector might want to follow, guarenteed to be
+-- the size of a pointer.
+basicGCType :: String -> Type
+basicGCType s = TB s True
hunk ./data/jhc_rts2.c 7
-#define GETWHAT(x)   (DNODEP(x)->what)
hunk ./data/jhc_rts2.c 15
+#define GETWHAT(x)   (DNODEP(x)->what)
+#define SETWHAT(x,v)   (DNODEP(x)->what = (v))
hunk ./data/jhc_rts2.c 119
-typedef uintptr_t      what_t;
+typedef uint16_t       what_t;