Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/visualization/cfgViewer.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/visualization/cfgViewer.sml

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

revision 1124, Thu Mar 7 19:49:22 2002 UTC revision 1125, Thu Mar 7 21:04:13 2002 UTC
# Line 7  Line 7 
7          end =          end =
8  struct  struct
9     structure CFG = CFG     structure CFG = CFG
    structure W   = CFG.W  
10     structure L = GraphLayout     structure L = GraphLayout
11     structure FMT = FormatInstruction(Asm)     structure FMT = FormatInstruction(Asm)
12     structure G = Graph     structure G = Graph
# Line 27  Line 26 
26         val EXIT  = hd(#exits g ())         val EXIT  = hd(#exits g ())
27    
28         fun edge(i,j,CFG.EDGE{w, ...}) =         fun edge(i,j,CFG.EDGE{w, ...}) =
29         let val label = L.LABEL(W.toString (!w))         let val label = L.LABEL(Real.toString (!w))
30             val color =             val color =
31                 if i = ENTRY orelse j = EXIT then green (* special edge *)                 if i = ENTRY orelse j = EXIT then green (* special edge *)
32                 else if i+1 = j then yellow (* fallsthru *)                 else if i+1 = j then yellow (* fallsthru *)
# Line 35  Line 34 
34         in  [label, color] end         in  [label, color] end
35    
36         fun title(blknum,ref freq) =         fun title(blknum,ref freq) =
37             " "^Int.toString blknum^" ("^W.toString freq^")"             " "^Int.toString blknum^" ("^Real.toString freq^")"
38    
39         fun ann(annotations) =         fun ann(annotations) =
40              List.foldl(fn (a,l) => "/* "^Annotations.toString a^" */\n"^l) ""              List.foldl(fn (a,l) => "/* "^Annotations.toString a^" */\n"^l) ""

Legend:
Removed from v.1124  
changed lines
  Added in v.1125

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