[add alignment constraints to structures, clean up and annotate more of the rts
John Meacham <john@repetae.net>**20080313170334] hunk ./C/FromGrin2.hs 47
-    wStructures :: Map.Map Name [(Name,Type)],
+    wStructures :: Map.Map Name Structure,
hunk ./C/FromGrin2.hs 88
-    (header,body) = generateC False (Map.elems fm) (Map.assocs sm)
+    (header,body) = generateC False (Map.elems fm) (Map.elems sm)
hunk ./C/FromGrin2.hs 716
-    unless (null fields) $ tell mempty { wStructures = Map.singleton (nodeStructName n) fields }
+    unless (null fields) $ tell mempty { wStructures = Map.singleton (nodeStructName n) $ Structure { structureName = nodeStructName n, structureFields = fields, structureAligned = True } }
hunk ./C/FromGrin2.hs 744
-    tellFunctions [function fname wptr_t [(aname,atype)] [a_STD] (body & update & creturn rvar )]
+    tellFunctions [function fname wptr_t [(aname,atype)] [a_STD, a_FALIGNED] (body & update & creturn rvar )]
hunk ./C/FromGrin2.hs 798
+a_FALIGNED = Attribute "A_FALIGNED"
hunk ./C/Generate.hs 3
+    Structure(..),
hunk ./C/Generate.hs 570
+data Structure = Structure {
+    structureName :: Name,
+    structureFields :: [(Name,Type)],
+    structureAligned :: Bool
+    }
+
hunk ./C/Generate.hs 578
-    -> [(Name,[(Name,Type)])]  -- ^ extra structures
+    -> [Structure]             -- ^ extra structures
hunk ./C/Generate.hs 584
-        let shead = vcat $ map (text . (++ ";") . ("struct " ++) . show . fst) ss
+        let shead = vcat [ text "struct" <+> tshow (structureName s) <> (if structureAligned s then text " A_ALIGNED" else empty) <> text ";" | s <- ss ]
hunk ./C/Generate.hs 589
-    anons = [ (n, fields ts ) | (ts,n) <- Map.toList ass ] where
+    anons = [ Structure { structureName = n, structureFields = fields ts, structureAligned = False }  | (ts,n) <- Map.toList ass ] where
hunk ./C/Generate.hs 595
-    declStructs ht ss = liftM vsep $ forM ss $ \ (n,ts) -> do
+    declStructs ht ss = liftM vsep $ forM ss $ \ Structure { structureName = n, structureFields = ts } -> do
hunk ./data/rts/jhc_rts.c 29
-static void
+static void A_COLD
hunk ./data/rts/jhc_rts.c 55
-static void A_NORETURN A_UNUSED
+static void A_NORETURN A_UNUSED A_COLD
hunk ./data/rts/jhc_rts.c 61
-static void  A_NORETURN A_UNUSED
+static void  A_NORETURN A_UNUSED  A_COLD
hunk ./data/rts/jhc_rts.c 69
-static void  A_NORETURN A_UNUSED
+static void  A_NORETURN A_UNUSED  A_COLD
hunk ./data/rts/jhc_rts.c 114
-int
+int  A_COLD
hunk ./data/rts/jhc_rts2.c 184
-static inline wptr_t A_STD A_UNUSED
+static inline wptr_t A_STD A_UNUSED  A_HOT
hunk ./data/rts/jhc_rts2.c 192
-static inline sptr_t A_STD A_UNUSED
+static inline sptr_t A_STD A_UNUSED A_HOT
hunk ./data/rts/jhc_rts2.c 201
-static inline wptr_t A_STD A_UNUSED
+static inline wptr_t A_STD A_UNUSED  A_HOT
hunk ./data/rts/jhc_rts2.c 213
-static inline wptr_t A_STD A_UNUSED
+static inline wptr_t A_STD A_UNUSED  A_HOT
hunk ./data/rts/jhc_rts2.c 240
-static inline void A_STD A_UNUSED
+static inline void A_STD A_UNUSED A_HOT
hunk ./data/rts/jhc_rts_header.h 70
+// these should be enabled with newer versions of gcc
+#define A_HOT
+#define A_COLD
+#define A_FALIGNED