Incl: A Tool to Analyze Include Files
Kiem-Phong Vo, Yih-Farn Chen · 1992
Large C and C++ softwa¡e projects typically share common types, macros, and variables among modules via include files organized into hierarchies. Many of these hierarchies grow so complex that it is hæd for programmers to figure out when a file must be included. Since including unused symbols is usually harmless, application code tends to include more files than required. Knowing when ñles are or are not needed is useful to restructure the code and reduc.e the time required to build a product. It also helps in reorganizing the include hierarchies- should this be deemed necessary. Incl is a tool that analyzes include hierarchies!o (1) show the dependencies among include files in graphical or text forms, (2)infer what files are not needed, and (3) provide ways to remove unused include files. The inference and removal of unused include files must be done with care for that may change the meaning of the application programs. We shall describe precise conditions undir whiõh include files can be safely ignored for compilation and give a linear time algorithm to compute such files. Incl has been used on many projects and experience shows that, in many cases, eliminating unnecessary include files significantly reduces compilation time.