We have a method for computing representation sharing by using types to encode representations. We use polymorphic type inference to compute new types for all variables, eliminating cases of incidental type sharing where the variables might have different representations. The method is fully automatic and smoothly integrates pointer aliasing and higher-order functions. Because it is fully modular and computationally inexpensive, it should scale to very large systems.
We show how we used a prototype tool to analyze Morphin, a 17,000 line robot control program written in C, answering a userís questions about program structure, detecting abstraction violations, and finding unused data structures and memory leaks.
This work is described in Tech Report CMU-CS-96-130.
Another version, which is more readable, appeared in ICSE 97.
Lackwit is now available. It is not a product; this is simply a snapshot of my research code. You may well encounter some bugs; please tell me about any you find, but I make no guarantees about quality of support --- though I will to my best to deal with any problems that come up.
Instructions for installing Lackwit are available here.