CFLOW(CP) XENIX System V CFLOW(CP)
Name
cflow - Generates C flow graph.
Syntax
cflow [-r] [-ix] [-i_ ] [-dnum] file ...
Description
cflow analyzes a collection of C, YACC, LEX, assembler, and
object files and attempts to build a graph charting the
external references. Files ending in .y, .l, .c, and .i are
run through YACC, LEX, and the C-preprocessor (bypassed for
.i files) as appropriate, and then through the first pass of
lint(CP). (The -I, -D, and -U options of the C-preprocessor
are also understood.) Files suffixed with .s are assembled
and information is extracted (as in .o files) from the
symbol table. The results of this processing are collected
and turned into a graph of external references. This graph
is displayed on the standard output.
Each line of output begins with a line number, followed by a
suitable number of tabs indicating the level, the name of
the global procedure, a colon, and the definition. A global
procedure is normally a function not defined as an external
and not beginning with an underscore character (see the -i
option on the next page). For information extracted from C
source files, the definition includes an abstract type
declaration (for example, char *), and, enclosed by angle
brackets, the name of the source file and the line number
where the definition was found. Definitions extracted from
object files indicate the filename and location counter
under which the symbol appeared (for example, text).
Leading underscores in C-style external names are deleted.
Once a definition of a name has been printed, subsequent
references to that name contain only the number of the line
where the definition can be found. For undefined
references, only <> is printed.
As an example, given the following in file.c:
int i;
main()
{
f();
g();
f();
}
f()
{
i = h();
Page 1 (printed 8/7/87)
CFLOW(CP) XENIX System V CFLOW(CP)
}
the command:
cflow-ix file.c
produces the following C flow graph:
1 main: int(), <file.c 4>
2 f: int(), <file.c 11>
3 h: <>
4 i: int, <file.c 1>
5 g: <>
When the nesting level becomes too deep, the -e option of
pr(C) can be used to compress the tab expansion to something
less than every eight spaces.
The following options are interpreted by cflow:
-r Reverses the ``caller:callee'' relationship producing
an inverted listing showing the callers of each
function. The listing is also sorted in
lexicographical order by callee.
-ix Includes external and static data symbols. The
default is to include only functions in the flow
graph.
-i_ Includes names that begin with an underscore. The
default is to exclude these functions (and data if
-ix is used).
-dnum Indicates the depth (num decimal integer) at which
the flow graph is cut off. By default this is a very
large number. You can not set the cutoff depth to a
nonpositive integer.
-LARGE Uses large model versions of the compiler and lint
passes. This enables the handling of flexnames
(identifiers greater than 8 characters in length).
See Also
cc(CP), lex(CP), lint(CP), masm(CP), nm(CP), pr(C), yacc(CP)
Diagnostics
Complains about bad options. Complains about multiple
definitions and only believes the first. Other messages may
come from the various programs used (for example, the C-
preprocessor).
Notes
Page 2 (printed 8/7/87)
CFLOW(CP) XENIX System V CFLOW(CP)
Files produced by lex(CP) and yacc(CP) cause the reordering
of line number declarations which can confuse cflow. To get
proper results, use yacc or lex input for cflow.
Page 3 (printed 8/7/87)