摘要 |
PROBLEM TO BE SOLVED: To improve maintenability of a program, and to reduce the number of memory reference instructions by converting global variables into local variables in a source code. SOLUTION: When a function caller is present in a region to be converted extracted from a source code, whether or not global variables selected in a called function are used is decided. When the global variables are used, the alternative variables of the global variables are declared to the function caller. The alternative variables are added as arguments corresponding to the global variables to all the called functions using the global variables in the source code. A new function is generated by replacing the global variables in the called function with the added arguments. The function caller in the developed source code is corrected to call a new function. When this processing ends, the global variables are deleted from the developed source code. COPYRIGHT: (C)2009,JPO&INPIT
|