SCM Repository
[smlnj] / sml / trunk / src / compiler / CodeGen / cpscompile / alignment.sml |
View of /sml/trunk/src/compiler/CodeGen/cpscompile/alignment.sml
Parent Directory
|
Revision Log
Revision 94 -
(download)
(annotate)
Tue May 12 21:56:22 1998 UTC (22 years, 11 months ago) by monnier
File size: 1507 byte(s)
Tue May 12 21:56:22 1998 UTC (22 years, 11 months ago) by monnier
File size: 1507 byte(s)
This commit was generated by cvs2svn to compensate for changes in r93, which included commits to RCS files with non-trunk default branches.
(* alignment.sml --- determine if the allocation pointer should be * aligned on entry to function. *) signature ALIGNMENT = sig val build : CPS.function list -> (int -> bool) end structure Alignment = struct structure C = CPS exception Alignment fun error msg = ErrorMsg.impossible ("Alignment." ^ msg) fun build(cluster) = let (* SortedList should be replaced by int-binary-set *) fun hasFloats(C.RECORD(rk, _, _, e)) = (case rk of (C.RK_FCONT | C.RK_FBLOCK) => true | _ => hasFloats(e)) | hasFloats(C.SELECT(_, _, _, _, e)) = hasFloats(e) | hasFloats(C.OFFSET(_, _, _, e)) = hasFloats(e) | hasFloats(C.APP _) = false | hasFloats(C.FIX _) = error "hasFloats: FIX" | hasFloats(C.SWITCH(_, _, el)) = let fun iter [] = false | iter(e::el) = hasFloats(e) orelse iter(el) in iter el end | hasFloats(C.BRANCH(_, _, _, e1, e2)) = hasFloats(e1) orelse hasFloats(e2) | hasFloats(C.SETTER(_, _, e)) = hasFloats(e) | hasFloats(C.LOOKER(_, _, _, _, e)) = hasFloats(e) | hasFloats(C.ARITH(_, _, _, _, e)) = hasFloats(e) | hasFloats(C.PURE(C.P.fwrap, _, _, _, _)) = true | hasFloats(C.PURE(_, _, _, _, e)) = hasFloats(e) fun doFunction((_,f,_,_,e), set) = if hasFloats e then SortedList.enter(f, set) else set in SortedList.member (List.foldl doFunction [] cluster) end (* build *) end (* * $Log: alignment.sml,v $ * Revision 1.1.1.1 1998/04/08 18:39:54 george * Version 110.5 * *)
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |