*To*: "Jose Moreira" <moreira@watson.ibm.com>*Cc*: sage-bugs@rainier.extreme.indiana.edu (Bugs in Sage++)*Subject*: Re: Question*In-Reply-To*: Your message of "Mon, 21 Aug 1995 16:20:49 PDT." <9508212020.AA19421@harpia.watson.ibm.com>*Date*: Tue, 22 Aug 1995 10:29:48 -0700*From*: Lars Thomas Hansen <lth@cs.uoregon.edu>*Sender*: owner-sage-bugs@extreme.indiana.edu

>I would like to know if Sage++ builds a control-flow graph of the >program that I can access. Well, yes and no. There are two tools of which I am aware, none of them appropriate for serious compiler work. First, if you want a static procedure call graph, look in Sage++/extentions/sgCallGraph.C, which extracts such a graph (and in instr/cgm.C for an example of how this module can be used). Second, if you want a procedure-wise control-flow graph, there is a prototypical implementation of a program which creates such a graph to be found in instr/cfg.C. However, it may be unsuitable for you for three reasons: it is largely unused at this time, hence relatively untested; it works only for C++ right now (from your previous messages I get the impression that you are working with Fortran); and it creates graphs which do not contain actual basic blocks but some which are a little extended: for example, if we have a = (c ? 1 : 2); this statement will be treated as a non-terminating statement for the block, even though it is clearly a decision point in the flow graph. In brief, the graph operates on a statement level, and control-flow within a statement (conditional expressions, short-circuit boolean evaluation) is ignored. The reason why the graph is coarse is because of its intended use: it is to be used for displaying source graphs to the user for manual insertion of profiling points. That said, it may be straightforward to make it work for Fortran, and perhaps it meets your needs. --lars

**Question***From*: "Jose Moreira" <moreira@watson.ibm.com>

- Prev:
**pb with fortran else if and insertStatementBefore** - Next:
**Question** - Index:
**Sage-bugs 1995 Mail Archive**