Source: http://www.google.com/patents/US20040205736?dq=6289460
Timestamp: 2017-11-21 14:29:53
Document Index: 656399429

Matched Legal Cases: ['art 105', 'art 108', 'art 105', 'art 1121', 'art 1122', 'art 1121', 'art 1122']

Patent US20040205736 - Compile method and program recording medium - Google Patents
A compiler, that generates an object program file from a source program in which a plurality of procedures are written, compiles procedures, by regarding the procedures as source-program compile units, to generate corresponding object-program compile units. A plurality of object-program compile units...http://www.google.com/patents/US20040205736?utm_source=gb-gplus-sharePatent US20040205736 - Compile method and program recording medium
Publication number US20040205736 A1
Application number US 09/810,191
Also published as EP1202171A2, EP1202171A3, US6983457
Publication number 09810191, 810191, US 2004/0205736 A1, US 2004/205736 A1, US 20040205736 A1, US 20040205736A1, US 2004205736 A1, US 2004205736A1, US-A1-20040205736, US-A1-2004205736, US2004/0205736A1, US2004/205736A1, US20040205736 A1, US20040205736A1, US2004205736 A1, US2004205736A1
Inventors Masato Mitsumori, Shinji Asaki, Hiroyuki Hosotani
Original Assignee Masato Mitsumori, Shinji Asaki, Hiroyuki Hosotani
Patent Citations (12), Referenced by (8), Classifications (4), Legal Events (4)
Compile method and program recording medium
US 20040205736 A1
A compiler, that generates an object program file from a source program in which a plurality of procedures are written, compiles procedures, by regarding the procedures as source-program compile units, to generate corresponding object-program compile units. A plurality of object-program compile units generated are output to a memory together with the corresponding source-program compile units. When compiling a source program in which one procedure has been changed, the compiler compiles only the source-program compile unit corresponding to the changed procedure.
1-19. (Canceled).
20. A compile method for generating an object program file from a source program having a plurality of procedures, comprising the steps of:
in addition to storing said plurality of object-program compile units and said plurality of source-program compile units, storing analysis information obtained by syntax analysis of said source-program in said object program file;
after making a change in said source program, analyzing syntax of said source program;
comparing said analysis information obtained by said syntax analysis with said analysis information stored in said object program file;
if both the analysis information do not coincide, compiling a plurality of source-program compile units constituting said change source program, to generate a plurality of new object-program compile units; and
updating said plurality of source-program compile units stored in said object program file so as to be the same as said plurality of source-program compile units constituting said changed source program, updating said plurality of object-program compile units stored in said object program file so as to be the same as said new object-program compile units, and updating said analysis information stored in said object program file so as to be the same as the analysis information thus obtained,
wherein said analysis information is a version of a compiler used for compilation.
21. A compiler for generating an object program file from a source program having a plurality of procedures, comprising;
a processing part for, by regarding procedure of said source program as source-program compile units, compiling said procedures on a procedure basis to generate a plurality of object-program compile units;
a processing part for storing said plurality of object-program compile units and said plurality of source-program compile units respectively associated with one another, said plurality of source-program compile units being used to update said object-program file on an object-program compile unit basis;
a processing part, in addition to storing said plurality of object-program compile units and said plurality of source-program compile units, storing analysis information resulting from syntax analysis of said source program in said object program file;
a processing part for analyzing syntax of said source program after changes are made in said source program;
a processing part for comparing analysis information obtained by said syntax analysis with said analysis information stored in said object program file;
a processing part for, if both the analysis information do not coincide, compiling a plurality of source-program compile units constituting said changed source program, to generate a plurality of new object-program compile units;
a processing part for updating said plurality of source-program compile units stored in said object program file so as to be the same as said plurality of source-program compile units constituting said changed source program, and updating said plurality of object-program compile units stored in said object program file so as to be the same as said plurality of new object-program compile units, and updating said analysis information stored in said object program file so as to be the same as said analysis information thus obtained; and
an output part for outputting said object program file,
22. A compile method for generating an object program file from a source program having a plurality of procedures, comprising the steps of:
in addition to storing said plurality of object-program compile units and said plurality of source-program compile units, storing analysis information obtained by syntax analysis of said source program in said object program file;
if both the analysis information do not coincide, compiling a plurality of source-program compile units constituting said changed source program to generate a plurality of new object-program compile units; and
wherein said analysis information is an optimization level of a compiler used for compilation.
23. A compiler for generating an object program file from a source program having a plurality of procedures, comprising;
a processing part for, by regarding procedures of said source program as source-program compile units, compiling said procedures on a procedure basis to generate a plurality of object-program compile units;
a processing part for storing said plurality or object-program compile units and said plurality of source-program compile units respectively associated with one another, said plurality of source-program compile units being used to update said object program file on an object-program compile unit basis;
a processing part for, if both the analysis information do not coincide, compiling a plurality of source-program compile units constituting said changed source program to generate a plurality of new object-program compile units;
a processing part for updating said plurality of source-program compile units stored in said object program file so as to be the same as said plurality of source-program compile units constituting said changed source program, and updating said plurality of object-program compile units stored in said object program file so as to be the same as said plurality of new object-program compile units, and updating said analysis information stored in said object program file so as to be the same as said analysis information obtained; and
24. A compile program executing a compile method for generating an object program file from a source program having a plurality of procedures on a computer, comprising the steps of:
25. A compile program executing a compile method for generating an object program file from a source program having a plurality of procedures on a computer, comprising the steps of:
The present invention relates to a compile method of inputting a plurality of source program files into a compiler and storing a created object program as an object program file in memory.
As means for automatic execution of a compile process such as was mentioned above, a “make” tool is often used. The “make” tool is a tool to generate one object program file from a plurality of source program files, manages dates of a plurality of source program files, and compiles only source program files with dates later than that of an object program file. An example of this technique is disclosed in JP-A-08-87416.
An object of the present invention is to provide a compile method capable of eliminating a wasteful compile process. This object may be achieved by omitting the compile process on a procedure that has never been changed when a source program file is input, where the source program file includes the procedure to which no change has been made from a previous compile till compile this time.
With regard to information used to identify a changed procedure (hereafter referred to as “source information”), not only the source program but also information used for analysis of the syntax of the source program, i.e., source information and the object program may be stored in the object program file.
[0013]FIG. 1 is a block diagram of an embodiment of the compiler according to the present invention;
[0014]FIG. 2 is a flowchart of the source program analyzer part in the embodiment of the present invention;
[0015]FIG. 3 is a flowchart of the object program file generator part in the embodiment of the present invention;
[0016]FIG. 4 is a flowchart when giving an instruction to compare source programs to the compiler in the embodiment of the present invention;
[0017]FIG. 5 is a flowchart when giving an instruction to output a source program to the compiler in the embodiment of the present invention;
[0018]FIG. 6 is a diagram showing the structure of an object program file in the embodiment of the present invention;
[0019]FIG. 7 shows an example of a source program file;
[0020]FIG. 8 shows a structure example of an object program file;
[0021]FIG. 9 shows a structure example of another object program file.
[0023]FIG. 1 a block diagram of the compiler of an embodiment of the present invention. A source program file (e.g., file name “test.c”) 101 stored in a storage device 106 is transferred to a compiler 102 according to the present invention and is compiled. Then, an object program file (e.g., file name “test.o”) 112 is output to the storage device 106. The structure of the object program file 112 is such that the object program file includes an object program generated by compiling and a source program corresponding to the object program as will be described later.
[0027]FIG. 2 shows the flow of process steps in the source program analyzer part 105. A decision is made whether or not an object program file (e.g., “test.o”) 112 exists which corresponds to the source program file (e.g., “test.c”) 101 specified to the compiler (step 201) as the one to be compiled. If the decision made is that a corresponding object program file 112 does not exist, this is a case where the source program is compiled for the first time. In this case, because the source program of all procedures in the source program file 101 is compiled, a step 701, which will be described later, is carried out on all procedures. If there exists a corresponding object program file 112, a decision is made whether or not a source program, which was stored at its previous compiling, exists in the object program file 112 (step 202). If the result of decision at the step 202 is that the source program concerned does not exist in the object program file 112, the source program of all procedures in the source program file 101 is compiled and, therefore, the process in the step 701, described later, is carried out on all procedures. If the source program concerned exists in the object program file 112, a decision is made whether or not a source-program compile unit for the procedure being compiled exists in the object program file 112 (step 204). If the result of decision is that the source-program compile unit for the procedure being compiled does not exist, a decision is made that this procedure is newly added, and to compile this procedure, the process in the step 701, described later, is the carried out on this procedure. If there exists a source-program compile unit for the procedure being compiled, the source program corresponding to the source program file 101 as the object of compiling is read one procedure after another from the object program file 112 (step 203). Next, the source-program compile unit for the procedure being compiled is compared with the source-program compile unit for a corresponding procedure in the object program file 112 to decide whether they coincide with each other (step 205). If it is decided that there is disagreement between the source program of the procedure being compiled and the source program of a corresponding procedure in the object program file 112, a decision is made that the procedure concerned has been changed, and to compile the procedure concerned, the process in the next step 701 is carried out on the procedure. If they coincide with each other, the procedure concerned has not been changed, the procedure does not require compiling, so that the process in the step 701 is not carried out. Note that if a plurality of procedures in one source program have been changed, the process steps 203 and 204 should executed as many times as the procedures. In the step 701, the optimization process is to be carried out on a procedure of a source program where a change occurred, or on the source program itself. By performing the steps of the above-mentioned flowchart, a procedure being compiled can be searched for any change made and compiled when necessary. A decision can be made whether to compile or not on every procedure, so that those which are compiled and those which are not compiled can be separated.
[0028]FIG. 3 is a flowchart for explaining the process of the object program file generator part 108. The source program analyzer part 105, which has been described, detects a change in a procedure of a source program and decides if the optimization process has been done on this procedure (step 301). If a decision result shows that there is a procedure subjected to the optimization process, steps 302, 303, 304 are carried out.
[0035]FIG. 7 is a diagram showing an example of a source program stored in a source program file 101. The source program has two procedures, func1 and func2. The compiler according to the present invention generates an object program file 112 shown in FIG. 8. The object program file 112 includes an object program part 1121 and a source program part 1122. The object program part 1121 includes an object-program compile unit 801 for func1 and an object-program compile unit 802, and the source program part 1122 includes a source-program compile unit 803 for func1 and a source-program compile unit 804 for func2, stored in a compile process, which respectively correspond to the object-program compile units 810 and 802.
US5778212 * Jun 3, 1996 Jul 7, 1998 Silicon Graphics, Inc. Interprocedural analysis user interface
US7908596 * Jan 5, 2007 Mar 15, 2011 International Business Machines Corporation Automatic inspection of compiled code
US8631393 * Sep 14, 2009 Jan 14, 2014 Vision Genesis, Inc. Custom database system and method of building and operating the same
US20080168426 * Jan 5, 2007 Jul 10, 2008 International Business Machines Corporation Automatic inspection of compiled code
US20100070954 * Sep 14, 2009 Mar 18, 2010 Mark Pomponio Custom database system and method of building and operating the same
U.S. Classification 717/142
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:MITSUMORI, MASATO;ASAKA, SHINJI;HOSOTANI, HIROYUKI;REEL/FRAME:016486/0803;SIGNING DATES FROM 20010305 TO 20010307