• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2007, Vol. 29 ›› Issue (4): 111-115.

• 论文 • 上一篇    下一篇

跨文件编译模式与基于GCC的实现

郭学鹏[1,2] 赵克佳[2]   

  • 出版日期:2007-04-01 发布日期:2010-05-30

  • Online:2007-04-01 Published:2010-05-30

摘要:

有很多编译优化都与编译时的视野有关,较宽的视野能给编译器提供更详细的信息,从而能得到更好的优化效果。采用跨文件编译模式使编译器的视野扩大至整个程序将是未来的方向。本文总结了实现这种模式的一般流程以及所遇到的问题和解决方法,分析了三种已提出的跨文件过程间编译模式,最后给出了一个基于GCC3.4的跨文件编译框架的实现方法。

关键词: 跨文件编译模式 过程间优化 编译器

Abstract:

Many compilation optimizations bear relations with the scope the compiler can see. The larger scope a compiler can see, the more information it can ob tain, and the best effect its optimization will have. The cross-files compilation model that processes all files which constitute a program once at a ti  me will be the tendency of future compilers. In this paper, we summarize the questions and methods for the implementation of a cross-files compilation model, analyze three suggested models of cross-files inter-process compilation, and then give our cross-files compilation model which is designed based o n GCC 3. 4.

Key words: cross-files compilation models inter-procedure optimization, compiler