[add placeholders for class methods to attach rules to and get dependencies right
John Meacham <john@repetae.net>**20051020022803] hunk ./E/FromHs.hs 63
---tipe (TTuple ts) = ltTuple (map tipe ts)
---    tipe (TCon (Tycon n k)) = foldr ($) (ELit (LitCons (getName n) (map EVar es) rt)) (map ELam es) where
---        (ts,rt) = argTypes' (kind k)
---        es = [ (TVr (Just n) t) |  t <- ts | n <- localVars ]
hunk ./E/FromHs.hs 69
-
hunk ./E/FromHs.hs 109
-    --lt n = nameToInt (fromTypishHsName  n)
hunk ./E/SSimplify.hs 262
+                    _ | forceNoinline t -> return (tvrNum t,Many,t',e)
hunk ./E/SSimplify.hs 436
+    -- NOINLINE must take precidence because it is sometimes needed for correctness, while INLINE is surely an optimization.
hunk ./E/SSimplify.hs 438
+        | forceNoinline x = False
hunk ./E/SSimplify.hs 443
+        | forceNoinline x = False
hunk ./E/SSimplify.hs 448
-        | Properties p <- Info.fetch (tvrInfo x) = Set.member prop_NOINLINE p -- || Set.member prop_WORKER p
+        | Properties p <- Info.fetch (tvrInfo x) = Set.member prop_NOINLINE p || Set.member prop_PLACEHOLDER p
hunk ./E/WorkerWrapper.hs 33
-    -> m (Name,E,[(Maybe (Constructor,[TVr]),TVr)])  -- ^ (Body,Args)
+    -> m (Maybe Name,E,[(Maybe (Constructor,[TVr]),TVr)])  -- ^ (Body,Args)
hunk ./E/WorkerWrapper.hs 44
-    f e _ (Tup n) ts = return (n,e,reverse ts)
-    f e _ (Tag [n]) ts = return (n,e,reverse ts)
+    f e _ (Tup n) ts = return (Just n,e,reverse ts)
+    f e _ (Tag [n]) ts = return (Just n,e,reverse ts)
+    f e _ _ ts | any (isJust . fst) ts = return (Nothing ,e,reverse ts)
hunk ./E/WorkerWrapper.hs 80
-        body' = eLetRec lets $ eCase body [cb] Unknown
-        cb = Alt (LitCons cname vars bodyTyp) (if isSingleton then EVar sv else (ELit $ unboxedTuple (map EVar vars)))
+        body' = eLetRec lets $ case cname of
+            Just cname -> eCase body [cb] Unknown where
+                cb = Alt (LitCons cname vars bodyTyp) (if isSingleton then EVar sv else (ELit $ unboxedTuple (map EVar vars)))
+            Nothing -> body
hunk ./E/WorkerWrapper.hs 85
-        ne | isSingleton = cases $ eStrictLet sv (foldl EAp (EVar tvr') (map EVar args'))  (ELit $ LitCons cname [EVar sv] bodyTyp)
-           | otherwise = cases $ eCase (foldl EAp (EVar tvr') (map EVar args')) [ca] Unknown
-        ca = Alt (unboxedTuple vars) (ELit $ LitCons cname (map EVar vars) bodyTyp)
-    vars@(~[sv]) = [  tVr i t | t <- slotTypes dataTable cname bodyTyp | i <- [2,4..] ]
+        ne | Just cname <- cname, isSingleton = cases $ eStrictLet sv (foldl EAp (EVar tvr') (map EVar args'))  (ELit $ LitCons cname [EVar sv] bodyTyp)
+           | Just cname <- cname = let ca = Alt (unboxedTuple vars) (ELit $ LitCons cname (map EVar vars) bodyTyp) in  cases $ eCase (foldl EAp (EVar tvr') (map EVar args')) [ca] Unknown
+           | otherwise = cases $ (foldl EAp (EVar tvr') (map EVar args'))
+    vars@(~[sv]) = [  tVr i t | t <- slotTypes dataTable (fromJust cname) bodyTyp | i <- [2,4..] ]
hunk ./Info/Types.hs 61
+prop_PLACEHOLDER = toAtom "_PLACEHOLDER"
hunk ./Main.hs 9
-import Maybe
hunk ./Main.hs 14
+import CanType(getType)
hunk ./Main.hs 18
+import C.Prims
hunk ./Main.hs 28
+import E.Inline
hunk ./Main.hs 36
+import E.TypeAnalysis
hunk ./Main.hs 44
-import CanType(getType)
hunk ./Main.hs 62
-import E.TypeAnalysis
hunk ./Main.hs 124
-annotateMethods ch rs ps = (Map.fromList [ (tvrIdent t, Just (EVar t)) | t <- ts ]) where
-    ts = [ let Identity x = idann rs ps (tvrIdent t) (tvrInfo t) in t { tvrInfo = x  } | t <-methodNames ch ]
+--annotateMethods ch rs ps = (Map.fromList [ (tvrIdent t, Just (EVar t)) | t <- ts ]) where
+--    ts = [ let Identity x = idann rs ps (tvrIdent t) (tvrInfo t) in t { tvrInfo = x  } | t <-methodNames ch ]
hunk ./Main.hs 130
-    let imap = annotateMethods (hoClassHierarchy ho) (hoRules ho) (hoProps ho)
+    --let imap = annotateMethods (hoClassHierarchy ho) (hoRules ho) (hoProps ho)
hunk ./Main.hs 134
-    let Identity (ELetRec ds (ESort EStar)) = annotate imap (idann (hoRules ho) (hoProps ho) ) letann lamann (ELetRec (Map.elems $ hoEs ho) eStar)
+    let Identity (ELetRec ds (ESort EStar)) = annotate mempty (idann (hoRules ho) (hoProps ho) ) letann lamann (ELetRec (Map.elems $ hoEs ho) eStar)
hunk ./Main.hs 159
-    ds <- convertDecls (hoClassHierarchy ho') allAssumps  fullDataTable decls
+    ds' <- convertDecls (hoClassHierarchy ho') allAssumps  fullDataTable decls
+    let mnames = methodNames (hoClassHierarchy ho')
+        ds = ds' ++ [ (runIdentity $ fromId (tvrIdent t),setProperties [prop_PLACEHOLDER,prop_EXPORTED] t, EPrim (primPrim ("Placeholder: " ++ tvrShowName t)) [] (getType t)) | t <- mnames, not $ t `Set.member` cnames]
+        cnames = Set.fromList $ fsts $ Map.elems $ hoEs ho
hunk ./Main.hs 166
-    let allRules = hoRules ho `mappend` rules
+    let allRules = hoRules ho `mappend` rules `mappend` hoRules ho'
hunk ./Main.hs 170
-    let inscope =  [ tvrNum n | (n,_) <- Map.elems $ hoEs ho ] ++ [tvrNum n | (_,n,_) <- ds ] ++ map tvrNum (methodNames (hoClassHierarchy allHo))
+    let inscope =  [ tvrIdent n | (n,_) <- Map.elems $ hoEs ho ] ++ [tvrIdent n | (_,n,_) <- ds ] ++ map tvrIdent (methodNames (hoClassHierarchy allHo))
hunk ./Main.hs 173
-        classNames = Set.fromList $ map tvrNum (methodNames (hoClassHierarchy allHo))
+        classNames = Set.fromList $ map tvrIdent (methodNames (hoClassHierarchy allHo))
hunk ./Main.hs 179
-        nfo <- idann (hoRules ho') (hoProps ho') (tvrIdent v) (tvrInfo v)
+        nfo <- idann  allRules (hoProps ho') (tvrIdent v) (tvrInfo v)
hunk ./Main.hs 232
-        let nvls = [ (fromJust (fromId (tvrIdent t)),t,e)  | (t,e) <- cds ]
+        let toName t
+                | Just n <- fromId (tvrIdent t) = n
+                | otherwise = error $ "toName: " ++ tvrShowName t
+        let nvls = [ (toName t,t,e)  | (t,e) <- cds ]
hunk ./Main.hs 245
-    let imap = annotateMethods (hoClassHierarchy allHo) allRules (hoProps allHo)
-        initMap = Map.fromList [ (tvrIdent t, Just (EVar t)) | (t,_) <- (Map.elems (hoEs ho))] `mappend` imap
-        graph =  (newGraph ds (\ (_,b,_) -> tvrNum b) (\ (_,_,c) -> freeVars c))
+    -- let imap = annotateMethods (hoClassHierarchy allHo) allRules (hoProps allHo)
+    let initMap = Map.fromList [ (tvrIdent t, Just (EVar t)) | (t,_) <- (Map.elems (hoEs ho))]
+        graph =  (newGraph ds (\ (_,b,_) -> tvrIdent b) (\ (_,b,c) -> bindingFreeVars b c))
hunk ./Main.hs 250
-    (ds,_) <- foldM f ([],(Map.fromList [ (tvrNum v,e) | (v,e) <- Map.elems (hoEs ho)], initMap, Set.empty)) (map fscc $ scc graph)
+    (ds,_) <- foldM f ([],(Map.fromList [ (tvrIdent v,e) | (v,e) <- Map.elems (hoEs ho)], initMap, Set.empty)) (map fscc $ scc graph)
hunk ./Main.hs 254
-    let ds' = reachable (newGraph ds (\ (_,b,_) -> tvrNum b) (\ (_,_,c) -> freeVars c)) [ tvrNum b | (n,b,_) <- ds, getProperty prop_EXPORTED b]
+    let ds' = reachable (newGraph ds (\ (_,b,_) -> tvrIdent b) (\ (_,b,c) -> bindingFreeVars b c)) [ tvrIdent b | (n,b,_) <- ds, getProperty prop_EXPORTED b]
hunk ./Main.hs 304
-    let initMap = Map.fromList [ (tvrIdent t, Just (EVar t)) | (t,_) <- (Map.elems (hoEs ho))]
hunk ./Main.hs 305
-    let Identity (ELetRec es'' (ESort EStar)) = annotate initMap (idann (hoRules ho) (hoProps ho) ) letann lamann (ELetRec [ (y,z) | (x,y,z) <- es']  eStar)
+    let initMap = Map.fromList [ (tvrIdent t, Just (EVar t)) | (t,_) <- (Map.elems (hoEs ho)), not $ t `Set.member` tmap]
+        tmap = Set.fromList $ [ t | (_,t,_) <- es' ]
+    let Identity es'' = annotateDs initMap (idann (hoRules ho) (hoProps ho) ) letann lamann [ (y,z) | (x,y,z) <- es']
hunk ./Main.hs 311
-        sequence_ [ putDocM CharIO.putErr (pprint $ ELetRec [(y,z)] Unknown) >> putErrLn "" |  (x,y,z) <- es']
+        sequence_ [ print x >> printCheckName' dataTable y z |  (x,y,z) <- es']
hunk ./Main.hs 315
-    let ds' = reachable (newGraph ds (tvrNum . fst) (\ (t,e) -> Set.toList $ freeVars e `mappend` freeVars (Info.fetch (tvrInfo t) :: ARules))) [tvrNum main]
+    let ds' = reachable (newGraph ds (tvrIdent . fst) (\ (t,e) -> bindingFreeVars t e)) [tvrIdent main]
hunk ./Main.hs 497
-        let ufreevars e | Just as <- fv = filter ( not . (`Set.member` as) . tvrNum) (freeVars e)
+        let ufreevars e | Just as <- fv = filter ( not . (`Set.member` as) . tvrIdent) (freeVars e)
hunk ./Main.hs 552
+
+
+