INTERPROCEDURAL SLICING USING DEPENDENCE GRAPHS

被引:146
作者
HORWITZ, S
REPS, T
BINKLEY, D
机构
[1] Univ. of Wisconsin-Madison, Madison
[2] Univ. of Wisconsin-Madison, Madison
[3] Univ. of Wisconsin-Madison, Madison
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 1990年 / 12卷 / 01期
关键词
D O I
10.1145/77606.77608
中图分类号
TP31 [计算机软件];
学科分类号
081202 [计算机软件与理论]; 0835 [软件工程];
摘要
The notion of a program slice, originally introduced by Mark Weiser, is useful in program debugging, automatic parallelization, and program integration. A slice of a program is taken with respect to a program point p and a variable x; the slice consists of all statements of the program that might affect the value of x at point p. This paper concerns the problem of interprocedural slicing—generating a slice of an entire program, where the slice crosses the boundaries of procedure calls. To solve this problem, we introduce a new kind of graph to represent programs, called a system dependence graph, which extends previous dependence representations to incorporate collections of procedures 1990 rather than just monolithic programs. Our main result is an algorithm for interprocedural slicing that uses the new representation. (It should be noted that our work concerns a somewhat restricted kind of slice: rather than permitting a program to be sliced with respect to program point p and an arbitrary variable, a slice must be taken with respect to a variable that is defined or used at p.) The chief difficulty in interprocedural slicing is correctly accounting for the calling context of a called procedure. To handle this problem, system dependence graphs include some data dependence edges that represent transitive dependences due to the effects of procedure calls, in addition to the conventional direct-dependence edges. These edges are constructed with the aid of an auxiliary structure that represents calling and parameter-linkage relationships. This structure takes the form of an attribute grammar. The step of computing the required transitive-dependence edges is reduced to the construction of the subordinate characteristic graphs for the grammar's nonterminals. © 1990, ACM. All rights reserved.
引用
收藏
页码:26 / 60
页数:35
相关论文
共 22 条
[1]
Aho A.V, 1986, COMPILERS PRINCIPLES
[2]
METHOD OF ATTRIBUTES FOR DATA FLOW ANALYSIS .2. DEMAND ANALYSIS [J].
BABICH, WA ;
JAZAYERI, M .
ACTA INFORMATICA, 1978, 10 (03) :265-272
[3]
BADGER L, 1988, 1988 P INT C PAR PRO
[4]
BANNING J, 1979, 6TH ANN ACM S PRINC, P29
[5]
CALLAHAN D, 1988, ACM SIGPLAN NOTICES, V23, P47
[6]
COOPER KD, 1988, ACM SIGPLAN NOTICES, V23, P57
[7]
THE PROGRAM DEPENDENCE GRAPH AND ITS USE IN OPTIMIZATION [J].
FERRANTE, J ;
OTTENSTEIN, KJ ;
WARREN, JD .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1987, 9 (03) :319-349
[8]
INTEGRATING NONINTERFERING VERSIONS OF PROGRAMS [J].
HORWITZ, S ;
PRINS, J ;
REPS, T .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1989, 11 (03) :345-387
[9]
HORWITZ S, 1988, 15TH ACM S PRINC PRO, P146
[10]
HORWITZ S, 1987, TR690 U WISCONSIN M