C-Breeze
还不错的一个基础设施
What is C-Breeze?
C-Breeze is an infrastructure for building C compilers. It is written in C++, and consists of a set of classes for representing a C program as an abstract syntax tree (AST). It includes many support classes for inspecting, manipulating, and analyzing the program in the AST form. We also provide a front end that parses C code (ANSI/ISO 9899-1990 standard) and generates the initial AST.
Building a compiler with C-Breeze
The overall process of building a C-Breeze compiler is as follows:
Download and upack the C-Breeze source.
Fix the Makefile.inc to reflect your local configuration.
Compile the classes to produce libc-breeze.a
Define one or more new compiler Phases.
Compile your new Phases and link against libc-breeze.a to produce an executable.
System requirements
The C-Breeze code itself is quite portable, but the C compilers built using C-Breeze can only compile C89 code. Therefore, C-Breeze compilers must have a C89-compliant preprocessor and C89-friendly system header files. We have found that the following configuration works well:
Compile the C-Breeze classes using g++ 3.x
Provide gcc 2.95.x (and accompanying header files) for your C-Breeze compiler to use as the preprocessor.
Citing C-Breeze
If you incorporate C-Breeze into your research, please let us know -- and please use the following citation in your publications:
The C-Breeze Compiler Infrastructure
Calvin Lin, Samuel Z. Guyer, Daniel Jimenez
TR-01-43, The University of Texas at Austin, November, 2001.
Passes
C-Breeze provides some built-in passes that process C code at various levels:
AST level passes
After initial parsing, C-Breeze represents C programs in a high-level AST form.
CFG/Dismantled level passes
Most analysis and optimization passes use a dismantled form of the AST that resembles a three-address code.
Backend passes
We currently provide an assembly code backend as well as a C-code backend ("unparsing"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 AST 上进行所有分析和优化,有 C 后端和 ASM 后端。
不错啊,哪个学校的啊?目前还不提供代码下载。
好像是 得克萨斯大学