LLVM

共8篇文章。

C++中的main定义

Development

新的C++标准中不允许给main指定linkage-specification了。

当然,考虑到原本main()也是C运行环境在开始运行程序的时候调用的,而C运行环境自然也预期C linkage,即不按照C++的习惯对符号根据参数增加名字前缀,因此大部分编译器在遇到C++程序定义全局main()的时候也会按照习惯采取C linkage方式去翻译。这一规则首先被GCC采纳,随后LLVM也跟进了。

阅读全文…:C++中的main定义(本文约455字,阅读大致需要1分钟)

clang优化器的一个问题

Development

📜 历史文件已不具备现实意义

今天的一个偶然的发现。FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525。clang 3.8 2015/07/20的版本同样有此问题。

之前,FreeBSD上strndup(3)的实现是这样的:

而OpenBSD上的实现,则是这样的:

阅读全文…:clang优化器的一个问题(本文约360字,阅读大致需要1分钟)

FreeBSD CLang/LLVM项目终于进svn了

Development

如题。

不过这一次因为-CURRENT code slush的缘故,应该不会在8.0-CURRENT里面引入了(Ed在svn里面建立了另一个branch来做)。我想从各方面考虑,9.0-RELEASE里面正式砍掉gcc那一套东西应该不会是很困难的事情。传统上FreeBSD的代码用到了很多gcc的扩展,因此可能还需要一段时间。

阅读全文…:FreeBSD CLang/LLVM项目终于进svn了(本文约237字,阅读大致需要1分钟)

LLVM: 为什么你需要关注这个项目

Development

LLVM是Illinois大学发起的一个开源项目,它到底是什么呢?从字面上看,它是一个虚机系统,然而这又和之前为大家所熟知的JVM以及 .net Runtime这样的虚机不同,它提供了一套中立的中间代码和编译基础设施,并围绕这些设施提供了一套全新的编译策略(使得优化能够在编译、连接、运行环境执行过程中,以及安装之后以有效的方式进行)和其他一些非常有意思的功能。

为什么这个项目很重要呢?对于普通的开发人员来说,LLVM计划提供了越来越多的可以使用、编译器以外的其他工具。例如代码静态检查工具LLVM/Clang Static Analyzer,是一个Clang的子项目,能够使用同样的Makefile生成HTML格式的分析报告;而对关注编译技术的开发人员来说,LLVM提供了很多优点:

阅读全文…:LLVM: 为什么你需要关注这个项目(本文约802字,阅读大致需要2分钟)

GCC运行环境豁免条款再次狠狠地打了苹果的耳光

Development

今年1月27日发表的《GCC运行环境豁免条款 (英文版)》再次狠狠地打了苹果的耳光。

原先的豁免条款如下:

// As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License.

阅读全文…:GCC运行环境豁免条款再次狠狠地打了苹果的耳光(本文约600字,阅读大致需要2分钟)

Progress on LLVM clang

Development

As some of you already know, FreeBSD, along with some other Open Source projects, is moving away from GCC due to GPLv3. From a technology perspective, this also makes sense since the (likely) candidate, BSD-style licensed, LLVM based clang, a C compiler, is making reasonably good progress.

So, what should we expect from LLVM or clang?

Here is a good comparison between GCC and clang. Despite GCC is popular, considerably more mature,and supports more languages (especially C++, which clang’s support is incomplete at this moment), clang provides cleaner AST (Abstract Syntax Tree), much more modularized (if you take a look at GCC’s history,Richard Stallman intentionally made GCC’s code not reusable in other software), provided much more information for optimizer, is much faster and use much less memory, etc.

For FreeBSD, currently, clang can compile its kernel with only very few tweaks.

阅读全文…:Progress on LLVM clang(本文约307字,阅读大致需要2分钟)
搜索文章…(按ESC退出)