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/emit/cfgEmit.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/emit/cfgEmit.sml

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

revision 983, Wed Nov 21 18:44:55 2001 UTC revision 984, Wed Nov 21 19:00:08 2001 UTC
# Line 5  Line 5 
5   * This module takes a flowgraph and an assembly emitter module and   * This module takes a flowgraph and an assembly emitter module and
6   * ties them together into one.  The output is sent to AsmStream.   * ties them together into one.  The output is sent to AsmStream.
7   *  --Allen   *  --Allen
8     *
9     * TODO: Need to check for the REORDER/NOREORDER annotation on
10     * blocks and call P.Client.AsmPseudoOps.toString function to
11     * print out the appropriate assembler directive. -- Lal.
12   *)   *)
13    
14  functor CFGEmit  functor CFGEmit
15    (structure CFG : CONTROL_FLOW_GRAPH    (structure E   : INSTRUCTION_EMITTER
16     structure E : INSTRUCTION_EMITTER     structure CFG : CONTROL_FLOW_GRAPH
17        where I = CFG.I and P = CFG.P) : ASSEMBLY_EMITTER =                     where I = E.I
18                         and P = E.S.P)  : ASSEMBLY_EMITTER =
19  struct  struct
   
20    structure CFG = CFG    structure CFG = CFG
21    
22    fun asmEmit (Graph.GRAPH graph, blocks) = let    fun asmEmit (Graph.GRAPH graph, blocks) = let
# Line 20  Line 24 
24          val E.S.STREAM{pseudoOp,defineLabel,emit,annotation,comment,...} =          val E.S.STREAM{pseudoOp,defineLabel,emit,annotation,comment,...} =
25               E.makeStream (!an)               E.makeStream (!an)
26          fun emitAn a = if Annotations.toString a = "" then () else annotation(a)          fun emitAn a = if Annotations.toString a = "" then () else annotation(a)
27          fun emitData (CFG.LABEL lab) = defineLabel lab          fun emitIt (id, CFG.BLOCK{labels, annotations=a, align, insns, ...}) = (
28            | emitData (CFG.PSEUDO pOp) = pseudoOp pOp                case !align of NONE => () | SOME p => (pseudoOp p);
29          fun emitIt (id, CFG.BLOCK{data, labels, annotations=a, insns, ...}) = (                List.app defineLabel (!labels);
               List.app emitData (!data);  
 (*            List.app defineLabel (!labels); *) (* JHR *)  
30                List.app emitAn (!a);                List.app emitAn (!a);
31                List.app emit (rev (!insns)))                List.app emit (rev (!insns)))
32          in          in
# Line 33  Line 35 
35          end          end
36  end  end
37    
38    
39    
40    
41    
42    
43    
44    
45    
46    

Legend:
Removed from v.983  
changed lines
  Added in v.984

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