Precise Call Graph Construction for OO Programs in the Presence of Virtual Functions

Abstract

Several intraand inter-procedural program analysis techniques form the backbone of an optimizing and parallelizing compiler. The eficacy o f these analyses depends upon how precise the call graph as. However, due t o lack of exact type information for objects in an object-oriented (00) program, the existing call graph. construction algorithms are rendered imprecise. In this paper, we present an algorithm for constructing a more precise call graph b y exploiting the static class hierarchy of an 00 program. The information collected during the class hierarchy analysis helps in avoiding unnecessary addition of many spurious call graph edges for virtual-function calls. We have implemented our algorithm for handling C++ programs within a restructuring tool, Sage++. With our precise algorithm for call graph construction, the percentage reduction in the number of nodes and edges in the call graphs fo r the benchmark programs we had selected, ranged between 4% to 56% and between 22% to 58%, respectively.

DOI: 10.1109/ICPP.1997.622674

5 Figures and Tables

Cite this paper

@inproceedings{Bairagi1997PreciseCG, title={Precise Call Graph Construction for OO Programs in the Presence of Virtual Functions}, author={Deepankar Bairagi and Dharma P. Agrawal and Sandeep Kumar}, booktitle={ICPP}, year={1997} }