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

SCM Repository

[smlnj] Diff of /sml/trunk/compiler/FLINT/flint/flintutil.sml
ViewVC logotype

Diff of /sml/trunk/compiler/FLINT/flint/flintutil.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4526, Fri Apr 13 18:32:56 2018 UTC revision 4527, Sat Apr 14 14:41:11 2018 UTC
# Line 1  Line 1 
1  (* flintutil.sml  (* flintutil.sml
2   *   *
3   * COPYRIGHT (c) 2017 The Fellowship of SML/NJ (http://www.smlnj.org)   * COPYRIGHT (c) 2018 The Fellowship of SML/NJ (http://www.smlnj.org)
4   * All rights reserved.   * All rights reserved.
5   *)   *)
6    
# Line 35  Line 35 
35    
36    val dcon_eq : FLINT.dcon * FLINT.dcon -> bool    val dcon_eq : FLINT.dcon * FLINT.dcon -> bool
37    
38    (* are two FLINT values equal? *)
39      val sameValue : FLINT.value * FLINT.value -> bool
40    
41    (* is a value a specific variable? *)
42      val valueIsVar : FLINT.lvar -> FLINT.value -> bool
43    
44  end (* signature FLINTUTIL *)  end (* signature FLINTUTIL *)
45    
46    
# Line 270  Line 276 
276       | F.PRIMOP (po,vs,lv,le) => fpo(addvs(S_rmv(lv, loop le), vs),po)       | F.PRIMOP (po,vs,lv,le) => fpo(addvs(S_rmv(lv, loop le), vs),po)
277  end  end
278    
279    (* are two FLINT values equal? *)
280      fun sameValue (v1, v2) = (case (v1, v2)
281             of (VAR x, VAR y) => (x = y)
282              | (INT n1, INT n2) => (n1 = n2)
283              | (INT32 n1, INT32 n2) => (n1 = n2)
284              | (WORD w1, WORD w2) => (w1 = w2)
285              | (WORD32 w1, WORD32 w2) => (w1 = w2)
286              | (REAL r1, REAL r2) => RealLit.same(r1, r2)
287              | (STRING s1, STRING s2) => (s1 = s2)
288              | _ => false
289            (* end case *))
290    
291    (* is a value a specific variable? *)
292      fun valueIsVar x (VAR y) = (x = y)
293        | valueIsVar _ _ = false
294    
295  end (* top-level local *)  end (* top-level local *)
296  end (* structure FlintUtil *)  end (* structure FlintUtil *)

Legend:
Removed from v.4526  
changed lines
  Added in v.4527

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