Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] generating a call-graph
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] generating a call-graph
> Does anyone know a way of generating a call-graph from a set of ocaml
> sources?  What I want to do is, at a minimum, get a list of all the
> functions that could be called as a result of a given function invocation.

This requires a non-trivial static analysis called "control flow
analysis" in the literature; particular instances include Shivers'
0-CFA and k-CFA, Jagannathan and Wright's "polymorphic splitting",

The difficulty is that functions are first-class values, so the
function you're applying can be a parameter to another function, or a
member of a data structure.  (Objects raise similar issues.)
Thus, the control flow cannot be determined independently of the data
flow, and "control flow analysis" is really a data flow analysis that
tracks the flow of functional values.

I don't know of any implementation of control-flow analysis for the
whole OCaml language.

- Xavier Leroy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: