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 1019, Wed Jan 16 18:34:31 2002 UTC revision 1020, Wed Jan 16 19:25:17 2002 UTC
# Line 224  Line 224 
224      fun getAnnotations () = CFG.annotations(!cfg)      fun getAnnotations () = CFG.annotations(!cfg)
225    
226      (* add a comment annotation to the current block *)      (* add a comment annotation to the current block *)
227      fun comment msg = addAnnotation (#create MLRiscAnnotations.COMMENT msg)        fun comment msg =
228            case !segmentF
229             of TEXT => addAnnotation (#create MLRiscAnnotations.COMMENT msg)
230              | _ => let
231                    val Graph.GRAPH graph = !cfg
232                    val CFG.INFO{data, ...} = #graph_info graph
233                  in data :=  PB.COMMENT msg :: !data
234                  end
235    
236    
237      (* -------------------------labels---------------------------*)      (* -------------------------labels---------------------------*)
# Line 286  Line 293 
293      end      end
294    
295      fun defineLabel lab =      fun defineLabel lab =
296            (case !segmentF
297             of TEXT =>
298        (case findLabel (hashLabel lab)        (case findLabel (hashLabel lab)
299          of NONE => let          of NONE => let
300               fun newBlk () =               fun newBlk () =
# Line 299  Line 308 
308                 labels := lab :: !labels;                 labels := lab :: !labels;
309                 addLabel(hashLabel lab, id)                 addLabel(hashLabel lab, id)
310             end             end
   
311           | SOME _ =>           | SOME _ =>
312               error (concat               error (concat
313                 ["multiple definitions of label \"", Label.toString lab, "\""])                 ["multiple definitions of label \"", Label.toString lab, "\""])
314            (*esac*))            (*esac*))
315             | _ => let
316                   (* non-text segment *)
317                   val Graph.GRAPH graph = !cfg
318                   val CFG.INFO{data, ...} = #graph_info graph
319                 in
320                  data := PB.DATA_LABEL lab :: !data
321                 end
322           (*esac*))
323    
324      fun entryLabel lab = (defineLabel lab; entryLabels := lab :: !entryLabels)      fun entryLabel lab = (defineLabel lab; entryLabels := lab :: !entryLabels)
325    in    in
# Line 320  Line 336 
336           exitBlock     = exitBlock,           exitBlock     = exitBlock,
337           endCluster    = endCluster           endCluster    = endCluster
338        }        }
339    end    end (* build *)
340  end  end

Legend:
Removed from v.1019  
changed lines
  Added in v.1020

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