Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/Semant/basics/inlinfo.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/Semant/basics/inlinfo.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1370 - (view) (download)

1 : blume 902 (* inlinfo.sml
2 :     *
3 :     * (C) 2001 Lucent Technologies, Bell Labs
4 : monnier 249 *)
5 : blume 902 structure InlInfo : INL_INFO = struct
6 : monnier 249
7 : blume 902 fun bug s = ErrorMsg.impossible ("InlInfo: " ^ s)
8 : monnier 249
9 : macqueen 1370 exception E of PrimOp.primop (* PRIMOP *)
10 : monnier 249
11 : blume 902 type inl_info = II.ii
12 : monnier 249
13 : blume 902 val INL_PRIM = II.Info o E
14 :     val INL_STR = II.List
15 :     val INL_NO = II.Null
16 : monnier 249
17 : blume 902 fun match i { inl_prim, inl_str, inl_no } =
18 :     case i of
19 :     II.Info (E x) => inl_prim x
20 :     | II.Info _ => bug "bogus Info node"
21 :     | II.List l => inl_str l
22 :     | II.Null => inl_no ()
23 : monnier 249
24 : blume 902 fun prInfo i = let
25 :     fun loop (i, acc) =
26 : macqueen 1370 match i { inl_prim = fn p => PrimOp.prPrimop p :: acc,
27 : blume 902 inl_no = fn () => "<InlNo>" :: acc,
28 :     inl_str = fn [] => "{}" :: acc
29 :     | h::t =>
30 :     "{" :: loop (h,
31 :     foldr (fn (x, a) =>
32 :     "," :: loop (x, a))
33 :     ("}" :: acc)
34 :     t) }
35 :     in
36 :     concat (loop (i, []))
37 :     end
38 : monnier 249
39 : blume 902 val selInfo = II.sel
40 : monnier 249
41 : blume 902 val isPrimInfo = II.isSimple
42 : monnier 249
43 : macqueen 1370 fun isPrimCallcc (II.Info (E (PrimOp.CALLCC | PrimOp.CAPTURE))) = true
44 : blume 902 | isPrimCallcc _ = false
45 : monnier 249
46 : macqueen 1370 fun pureInfo (II.Info (E p)) =
47 : blume 902 let fun isPure PrimOp.CAST = true
48 :     | isPure _ = false
49 :     (* val isPure = PrimOp.purePrimop *)
50 :     in
51 :     isPure p
52 :     end
53 :     | pureInfo _ = false
54 : monnier 249
55 : blume 902 val mkPrimInfo = INL_PRIM
56 :     val mkStrInfo = INL_STR
57 :     val nullInfo = INL_NO
58 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0