Compiler and method for avoiding unnecessary recompilation
First Claim
1. In a system for building a program executable on a computer, a method of minimizing rebuilding of the program following a revision, the method comprising the steps of:
- when building the program prior to the revision, compiling a source code file and at least one header file included by the source code file into an object code file;
analyzing dependencies of the object code file on classes declared in the at least one header file;
generating dependency data which approximates the dependencies of the object code file on the classes;
detecting changes to the classes from the revision;
generating change data relating to the changes to the classes;
calculating an intersection of the dependency data with the change data;
recompiling the source code file except when the intersection is nil and when the source code file is unchanged in the revision.
2 Assignments
0 Petitions
Accused Products
Abstract
A minimal rebuild system and process for minimizing rebuilding of a user'"'"'s programming project analyzes and records dependencies of object code files compiled in a previous build of the project on classes declared in header files. When rebuilding the project, the system detects and records changes made to the classes and header files since the project was last built. The system then determines whether to recompile the object code files from their respective source code files by comparing the recorded dependencies and changes. If an object code file'"'"'s dependencies do not intersect the changes, recompiling of the object code file can be omitted. The minimal rebuild system utilizes an approximate representation of the dependencies to yield an efficient system while ensuring that the project is correctly rebuilt.
-
Citations
21 Claims
-
1. In a system for building a program executable on a computer, a method of minimizing rebuilding of the program following a revision, the method comprising the steps of:
-
when building the program prior to the revision, compiling a source code file and at least one header file included by the source code file into an object code file; analyzing dependencies of the object code file on classes declared in the at least one header file; generating dependency data which approximates the dependencies of the object code file on the classes; detecting changes to the classes from the revision; generating change data relating to the changes to the classes; calculating an intersection of the dependency data with the change data; recompiling the source code file except when the intersection is nil and when the source code file is unchanged in the revision. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A system for minimizing rebuilding of a program for execution on a computer, comprising:
-
a compiler operative to compile a source code file and any header files included by the source code file into an object code file, and to analyze at least one type of dependency of the object code file being compiled on classes declared in said header files to yield any class dependencies of the object code file on the classes; a change detector for detecting at least one type of change made to the classes to yield any class changes; a minimal rebuild engine in communication with the compiler and the change detector for receiving the class dependencies from the compiler and the class changes from the change detector, the minimal rebuild engine being operative to compare the class dependencies and the class changes to determine whether the class dependencies of the object code file intersect the class changes; and a compiler driver in communication with the compiler and the minimal rebuild engine and operative to cause the compiler to compile a plurality of source code files for first building the program, and further operative to cause recompiling by the compiler of a subset of the source code files for rebuilding the program, wherein the subset of the source code files excludes the source code files that are unchanged since first building the program and that were compiled into object code files whose class dependencies do not intersect the class changes. - View Dependent Claims (12, 13, 14)
-
-
15. In a compiler, a method of minimizing rebuilding of an executable program, comprising the steps of:
-
storing information indicative of any dependencies of an object module on any of a plurality of classes declared in any header files used in last compiling the object module; detecting any changes made since last compiling the object module to said any header files and to any source files that were used in last compiling the object module; and recompiling the object module except at least where said detected changes are solely to parts of said classes which are not indicated by the stored information as dependencies of the object module. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification