if single compilation for each source file create call-graph convert source file to Clef AST for each routine in Clef AST convert routine from Clef AST to Scribble CFG add Scribble CFG to call-graph determine call sites from call-graph perform alias analysis on all Scribble CFG graphs together for each Scribble CFG in call-graph optimize Scribble CFG generate C code for top-level declarations generate C code for all Scribble CFGs in call-graph remove Clef AST, Scribble CFGs, and other information else // multi-compilation for each source file create call-graph convert source file to Clef AST for each routine in Clef AST convert routine from Clef AST to Scribble CFG add Scribble CFG to call-graph determine call sites from call-graph perform alias analysis on all Scribble CFG graphs together for each call-graph for each Scribble CFG in call-graph optimize Scribble CFG for each call-graph generate C code for top-level declarations generate C code for all Scribble CFGs in call-graphThe primary advantage of selecting multi-compilation is that the alias analysis may be done interprocedurally. The primary dis-advantage is the memory space required for the complete compilation.
For each source file a call-graph structure is used to keep track of the Scribble CFGs generated for each routine in the source file. A call-graph: