2006 2008 Copyright Tsinghua University Page 1 10

  • Slides: 29
Download presentation
编译原理专题训练 介绍 2006 ~ 2008 Copyright @ Tsinghua University Page 1

编译原理专题训练 介绍 2006 ~ 2008 Copyright @ Tsinghua University Page 1

任� 教� 董渊,博士 清华大学计算机系软件研究所 东主楼 10区 209 E-mail: dongyuan@tsinghua. edu. cn 电话: 62794240(办公室) 助教:朱允敏

任� 教� 董渊,博士 清华大学计算机系软件研究所 东主楼 10区 209 E-mail: dongyuan@tsinghua. edu. cn 电话: 62794240(办公室) 助教:朱允敏 东主楼 10区 202室 Email: zym 02@mails. tsinghua. edu. cn 电话: 62781474(O) 课程网址: http: //166. 111. 69. 150/? q=node/605 2006 ~ 2008 Copyright @ Tsinghua University Page 4

2006 ~ 2008 Copyright @ Tsinghua University Page 5

2006 ~ 2008 Copyright @ Tsinghua University Page 5

辅助教材 “编译原理”相关教材 英文版:龙书、虎书、鲸书 中文版:清华大学、国防科技大学、北京大学 “An Introduction to GCC for the GNU Compilers Gcc and

辅助教材 “编译原理”相关教材 英文版:龙书、虎书、鲸书 中文版:清华大学、国防科技大学、北京大学 “An Introduction to GCC for the GNU Compilers Gcc and G++” Brian Gough 开源文档,http: //gcc. org “The Use of The GNU Compilers” 开源文档,http: //gcc. org “The Internals of The GNU Compilers” 开源文档,http: //gcc. org 课程主页相关英文原版和翻译文档 开源文档,http: //166. 111. 69. 150 2006 ~ 2008 Copyright @ Tsinghua University Page 10

课程内容 2006 ~ 2008 Copyright @ Tsinghua University Page 12

课程内容 2006 ~ 2008 Copyright @ Tsinghua University Page 12

课程内容(二) 讲解 2:Linker and Loader 1)Linker介绍 2)目标文件与重定位 3)可执行文件及其加载 4)相关 具系统介绍 2006 ~ 2008 Copyright

课程内容(二) 讲解 2:Linker and Loader 1)Linker介绍 2)目标文件与重定位 3)可执行文件及其加载 4)相关 具系统介绍 2006 ~ 2008 Copyright @ Tsinghua University Page 15

课程内容(五) 讲解 5: GCC中间表示RTL 1)RTL综述 2)RTL的内部数据结构表示 3)RTL的外部线性文本表示 2006 ~ 2008 Copyright @ Tsinghua University

课程内容(五) 讲解 5: GCC中间表示RTL 1)RTL综述 2)RTL的内部数据结构表示 3)RTL的外部线性文本表示 2006 ~ 2008 Copyright @ Tsinghua University Page 18

Q&A Thank you… 2006 ~ 2008 Copyright @ Tsinghua University Page 23

Q&A Thank you… 2006 ~ 2008 Copyright @ Tsinghua University Page 23

编译系统介绍 Introduction of Compilers 2006 ~ 2008 Copyright @ Tsinghua University Page 24

编译系统介绍 Introduction of Compilers 2006 ~ 2008 Copyright @ Tsinghua University Page 24

Programming Language Goals • Original Model: – Computers expensive, people cheap; hand code to

Programming Language Goals • Original Model: – Computers expensive, people cheap; hand code to keep computer busy • Today: – People expensive, computers cheap; write programs efficiently and correctly 2006 ~ 2008 Copyright @ Tsinghua University Page 25

Programming Language Goals • Mythical Man-Month Author Fred Brookes “The most important two tools

Programming Language Goals • Mythical Man-Month Author Fred Brookes “The most important two tools for system programming … are (1) highlevel programming languages and (2) interactive languages” 2006 ~ 2008 Copyright @ Tsinghua University Page 26

Interpretation Versus Compilation • A compiler from language L 1 to language L 2

Interpretation Versus Compilation • A compiler from language L 1 to language L 2 is a program that takes an L 1 program and for each piece of code in L 1 generates a piece of code in L 2 of same meaning • 编译器 vs 翻译器 2006 ~ 2008 Copyright @ Tsinghua University Page 28

Interpretation Versus Compilation • An interpreter of L 1 in L 2 is an

Interpretation Versus Compilation • An interpreter of L 1 in L 2 is an L 2 program that executes the meaning of a given L 1 program • Compiler would examine the body of a loop once; an interpreter would examine it every time the loop was executed • 编译+解释 混合方式(JAVA) 2006 ~ 2008 Copyright @ Tsinghua University Page 29

Thank you… 2006 ~ 2008 Copyright @ Tsinghua University Page 30

Thank you… 2006 ~ 2008 Copyright @ Tsinghua University Page 30