From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA31772; Mon, 26 May 2003 11:14:26 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA31768 for ; Mon, 26 May 2003 11:14:25 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4Q9EGH09365; Mon, 26 May 2003 11:14:16 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA31715; Mon, 26 May 2003 11:14:16 +0200 (MET DST) Date: Mon, 26 May 2003 11:14:16 +0200 From: Xavier Leroy To: "Yaron M. Minsky" Cc: caml-list@inria.fr Subject: Re: [Caml-list] generating a call-graph Message-ID: <20030526111416.A31160@pauillac.inria.fr> References: <52762.141.155.88.179.1053707680.squirrel@minsky-primus.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <52762.141.155.88.179.1053707680.squirrel@minsky-primus.homeip.net>; from yminsky@CS.Cornell.EDU on Fri, May 23, 2003 at 12:34:40PM -0400 X-Spam: no; 0.00; caml-list:01 invocation:01 non-trivial:01 ocaml:01 polymorphic:01 first-class:02 objects:02 data:03 parameter:04 raise:05 functions:05 structure:06 functional:06 static:06 requires:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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", etc. 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 caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners