Determining the type of an object to which a receiver may point at a virtual call site is crucial for compile time virtual function resolution in C++ programs. We show the close interdependence of type determination and pointer-induced aliasing in C++ and present the first data-flow-based algorithm to solve these problems simultaneously. Our polynomial-time, approximation method incorporates information about program flow. Initial experiences with our prototype implementation have shown our technique to be more effective than others that use only inheritance hierarchy information. We present initial empirical results demonstrating the precision of our approach and state the intrinsic difficulty (i.e., NP-hardness) of the type determination problem for programming languages with general-purpose pointers and dynamic binding.
展开▼