Font Size: a A A

Research And Implementation On Models Of Cross-files Compilation

Posted on:2006-01-27Degree:MasterType:Thesis
Country:ChinaCandidate:X P GuoFull Text:PDF
GTID:2178360185463671Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Compilation optimization is an important aspect of the compiler design. Especially for the high performance compiler design, advanced compilation optimization methods can greatly enhance the effect of compiler optimization. Many compilation optimizations depend on the scope compiler can see. The larger scope a compiler can see, the more information it can obtain, and the best effect its optimization will have. Nowadays the source code of applications tend to locate in many separate files due to the increment of the application's size and the popularity of the software development model with OOP, so it is greatly necessary to evolve the traditional function-at-a-time or unit-at-a-time compilation model to support the cross-files compilation model. As rapid development of the computer hardware, the decrement of the memory's price and the emergence of microprocessors with large size cache make it possible to implement this compilation model.GNU C Compiler is one of the most important compilers in the open-source world. Its frond-end supports many kinds of languages, and back-end supports many kinds of target machines. GNU C Compiler has been widely used not only in general purpose computer systems but also in the embedded systems due to its ability to target many platforms and its architecture. But supportless of cross-files compilation model is a shortcoming of GNU C Compiler.Based on the study of the existing cross-files compilation models, we summaried the problems to deal with the cross-files compilation model and some methods to solve these problems. We analyzed the abstract syntax tree represent of GCC, the optimization on the call-graph, and the approach to the command-line arguments. We proposed a completely cross-files compilation model and extended GCC source code to save and restore AST, and to reconstruct call-graph of whole-program. Eventually we implemented the model based on GCC 3.4.Cross-files compilation model widens the compiler's scope and improves precision and effect of some compilation optimizations. Our test has shown that many optimizations, such as function inline, constant propagation etc, can benefit by the larger scope.
Keywords/Search Tags:Compilation optimization, cross-files compilation, GCC 3.4
PDF Full Text Request
Related items