Abstract
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.
This research was supported, in part, by funds from NSF grants GER90-23628, CCR92-08632 and Siemens Corporate Research.
Preview
Unable to display preview. Download preview PDF.
References
B. Calder and D. Grunwald. Reducing indirect function call overhead in C++ programs. In Conference Record of the Twenty-first Annual ACM Symposium on Principles of Programming Languages, pages 397–408, January 1994.
B. Calder, D. Grunwald, and B. Zorn. Quantifying behavioural differences between C and C++ programs. Journal of Programming Languages, 2:313–351, 1995.
W. Landi and B. G. Ryder. Pointer-induced aliasing: A problem classification. In Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages, pages 93–103, January 1991.
W. Landi and B. G. Ryder. A safe approximation algorithm for interprocedural pointer aliasing. In Proceedings of the SIGPLAN '92 Conference on Programming Language Design and Implementation, pages 235–248, June 1992.
H. Pande. Compile Time Analysis of C and C ++ Systems. PhD thesis, Rutgers University, May 1996.
H. Pande and B. G. Ryder. Static type determination for C++. In Proceedings of the Sixth USENIX C ++ Technical Conference, pages 85–97, April 1994.
H. D. Pande and B. G. Ryder. Static type determination and aliasing for C++. Laboratory for Computer Science Research Technical Report LCSRTR-236, Rutgers University, December 1994.
T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Conference Record of the Twenty-second Annual ACM Symposium on Principles of Programming Languages, pages 49–61, January 1995.
M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. In S. Muchnick and N. Jones, editors, Program Flow Analysis: Theory and Applications, pages 189–234. Prentice Hall, 1981.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pande, H.D., Ryder, B.G. (1996). Data-flow-based virtual function resolution. In: Cousot, R., Schmidt, D.A. (eds) Static Analysis. SAS 1996. Lecture Notes in Computer Science, vol 1145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61739-6_45
Download citation
DOI: https://doi.org/10.1007/3-540-61739-6_45
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61739-6
Online ISBN: 978-3-540-70674-8
eBook Packages: Springer Book Archive