Re: analyzing dependencies in code

IndianTechie <>
Sat, 17 Nov 2007 22:11:32 -0800 (PST)

          From comp.compilers

Related articles
analyzing dependencies in code (eliben) (2007-11-16)
Re: analyzing dependencies in code (2007-11-17)
Re: analyzing dependencies in code (IndianTechie) (2007-11-17)
Re: analyzing dependencies in code (Sid Touati) (2007-12-13)
| List of all articles for this month |

From: IndianTechie <>
Newsgroups: comp.compilers
Date: Sat, 17 Nov 2007 22:11:32 -0800 (PST)
Organization: Compilers Central
References: 07-11-047
Keywords: analysis
Posted-Date: 18 Nov 2007 12:22:02 EST

On Nov 16, 1:42 pm, eliben <> wrote:
> Hello,
> I have a bunch of rather convoluted C code that uses a lot of global
> variables. I'm trying to see if I can devise some automatic way of
> analyzing this code, helping me understand it.
> Suppose I can obtain the AST for this code (using c2c). I want to
> analyze the AST and, given some global variable V, understand which
> other global variables it affects, and what functions can be called as
> a result of a change in it.
> I tried approaching this the ad-hoc way, but it's becoming
> complicated. I see some parallels to dataflow analysis here, though it
> seems to be a bit different.

why would it be different? It is the same as data flow analysis,
except that you need to create a def-use chain only for globals.

> Any ideas of proven methods to do this right ?

can't think of why anyone would want to re-invent the wheel or how the
other technique would be more efficient than data flow analysis.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.