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/src/MLRISC/flowgraph/buildFlowgraph.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/flowgraph/buildFlowgraph.sml

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

revision 949, Fri Oct 5 01:30:26 2001 UTC revision 950, Fri Oct 5 20:10:46 2001 UTC
# Line 56  Line 56 
56      val entryLabels = ref ([] : Label.label list)      val entryLabels = ref ([] : Label.label list)
57      (* block id associated with a label*)      (* block id associated with a label*)
58      val labelMap    = IntHashTable.mkTable(32, LabelNotFound)      val labelMap    = IntHashTable.mkTable(32, LabelNotFound)
59      val lookupLabel = IntHashTable.lookup labelMap      val findLabel   = IntHashTable.find labelMap
60      val addLabel    = IntHashTable.insert labelMap      val addLabel    = IntHashTable.insert labelMap
61    
62      (* the block name annotation *)      (* the block name annotation *)
# Line 210  Line 210 
210      in data := !data @ [CFG.PSEUDO p]      in data := !data @ [CFG.PSEUDO p]
211      end      end
212    
213      fun defineLabel lab = let      fun defineLabel lab = (case findLabel (hashLabel lab)
214        val id = lookupLabel (hashLabel lab)             of NONE => let
       val blk as CFG.BLOCK{insns, ...} = #node_info graph id  
     in  
       currentBlock := blk;  
       blockList := blk :: !blockList;  
       insns := [];  
       #set_out_edges graph (id, [])  
     end  
       handle LabelNotFound => let  
215              val CFG.BLOCK{id, labels, data, ...} = newPseudoOpBlock()              val CFG.BLOCK{id, labels, data, ...} = newPseudoOpBlock()
216            in            in
217              labels := lab :: !labels;              labels := lab :: !labels;
218              data := !data @ [CFG.LABEL lab];    (* JHR *)              data := !data @ [CFG.LABEL lab];    (* JHR *)
219              addLabel(hashLabel lab, id)              addLabel(hashLabel lab, id)
220            end            end
221         | e => (print (exnName e); raise e)              | SOME _ => error (concat[
222                      "multiple definitions of label \"", Label.toString lab, "\""
223                    ])
224              (* end case *))
225    
226      fun entryLabel lab = (defineLabel lab; entryLabels := lab :: !entryLabels)      fun entryLabel lab = (defineLabel lab; entryLabels := lab :: !entryLabels)
227    

Legend:
Removed from v.949  
changed lines
  Added in v.950

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