compiler-construction - 通缉 : good definition of the term "lowering" in the context of compilers

标签 compiler-construction terminology

任何人都可以指出我在编译器的上下文中对术语“降低”的一个很好的定义吗?

据我所知,它是将更高级别的操作转换为较低级别操作的等效组合,但我不太确定,在Google上搜索几分钟后找不到。 (有一些“降低”的用法,例如在 GCCLLVM 中,但没有引用定义。)

最佳答案

Dobbs 博士刚刚发表 an article by Walter Bright (dlang 名气),他在那里提到了这个词:

Lowering

One semantic technique that is obvious in hindsight (but took Andrei Alexandrescu to point out to me) is called "lowering." It consists of, internally, rewriting more complex semantic constructs in terms of simpler ones. For example, while loops and foreach loops can be rewritten in terms of for loops. Then, the rest of the code only has to deal with for loops. This turned out to uncover a couple of latent bugs in how while loops were implemented in D, and so was a nice win. It's also used to rewrite scope guard statements in terms of try-finally statements, etc. Every case where this can be found in the semantic processing will be win for the implementation.

If it turns out that there are some special-case rules in the language that prevent this "lowering" rewriting, it might be a good idea to go back and revisit the language design.

Any time you can find commonality in the handling of semantic constructs, it's an opportunity to reduce implementation effort and bugs.

关于compiler-construction - 通缉 : good definition of the term "lowering" in the context of compilers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20252876/

相关文章:

c++ - 什么是 Blob ?

c# - .NET 编译器和 "Not all code paths return a value"

c++ - 有没有可以为 ubuntu 编译代码的在线、基于 html/flash/js 的免费 C++ 编辑器?

java - 您的 javadoc 是否被编译到您的类文件中?

linux - 如何使用 LDFLAGS -R 选项或其他方式在 make 中进行运行时链接

operating-system - 软件堆栈和操作系统有什么区别?为什么Android不是操作系统而是软件堆栈?

c++ - 谓词和仿函数有什么区别?

html - 开始和结束标签之间的文本术语?

programming-languages - 同形性究竟是什么意思?

C:运行时的编译器信息