我正在编译一个我一直在用LLVM 2.6和llvm-gcc前端进行编译的项目。我试图用LLVM 3.1和clang来测试它的编译。当我这样做,我得到了以下错误消息有关-O5优化级别:LLVM和Clang中的优化级别
error: invalid value '5' in '-O5'
然而,LLVM 2.6和LLVM-GCC已经工作得很好与-O5
标志。我看到了有关铛优化级别以下文件:
-O0 -O1 -O2 -Os -O3 -O4
Specify which optimization level to use. -O0 means "no optimization": this level compiles the
fastest and generates the most debuggable code. -O2 is a moderate level of optimization which
enables most optimizations. -Os is like -O2 with extra optimizations to reduce code size. -O3
is like -O2, except that it enables optimizations that take longer to perform or that may
generate larger code (in an attempt to make the program run faster). On supported platforms, -O4
enables link-time optimization; object files are stored in the LLVM bitcode file format and whole
program optimization is done at link time. -O1 is somewhere between -O0 and -O2.
所以我试图找出什么在我与摆在首位在做工作的Makefile中的-O5
(我没有写Makefile文件)。这是否改变了并用于LLVM?或者它仍然是一个有用的功能,我只需要以其他方式激活它。
此外,在情况下,它是非常有用的,我运行的是给错误的命令基本上是:
/bin/clang -g -c -mcmodel=medium -fstrict-aliasing -Wstrict-aliasing -O5 -emit-llvm -fkeep-inline-functions -fno-stack-protector -c -o foo.bc foo.cpp
同样的情况下,它很重要,我一个Linux(Ubuntu的10.04)x86_64的系统上运行。