© 1988 by British Computer Society
Efficient Implementation of Detection of Undefined Variables
Institute of Computer Science, Technical University of Silesia, Pstrowskiego 16, 44-100 Gliwice, Poland
Two algorithms for solving the problem of detecting undefined (or uninitialised) variables during compilation are considered. The first, well-known algorithm solves the problem by computing the use-definition chains for a program flow graph. Its time complexity is O(|N|2) where |N| is a number of nodes of the flow graph. An O(|N|) algorithm is proposed that analyses the direct acyclic graph of a reducible flow graph. The implementation of both algorithms in an Ada compiler are evaluated and compared.
The number of programming languages in use today is very large ... The number of high-quality language implementations, however, is quite small. W. A. Wulf26
Received October 1985. revised April 1987.
* Institute of Computer Science, Technical University of Silesia, Pstrowskiego 16, 44-100 Gliwice, Poland
Present address: University of California, Santa Barbara, California 93106.