Don't imply -flto with -O4.
We now saturate at -O3. llvm-svn: 189149
This commit is contained in:
parent
4b3c7ffc64
commit
493f045e75
|
@ -59,6 +59,8 @@ about them. The improvements since the 3.3 release include:
|
|||
New Compiler Flags
|
||||
------------------
|
||||
|
||||
- Clang no longer special cases -O4 to enable lto. Explicitly pass -flto to
|
||||
enable it.
|
||||
- ...
|
||||
|
||||
C Language Changes in Clang
|
||||
|
|
|
@ -1359,10 +1359,6 @@ bool Driver::IsUsingLTO(const ArgList &Args) const {
|
|||
if (Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false))
|
||||
return true;
|
||||
|
||||
// Check for -O4.
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_O_Group))
|
||||
return A->getOption().matches(options::OPT_O4);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
|
||||
|
@ -96,3 +95,6 @@
|
|||
|
||||
// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s
|
||||
// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"
|
||||
|
||||
// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s
|
||||
// CHECK-MAX-O: -O3
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// Check that -O4 is only honored as the effective -O option.
|
||||
// <rdar://problem/7046672> clang/loader problem
|
||||
|
||||
// RUN: %clang -ccc-print-phases -c -O4 -O0 %s 2> %t
|
||||
// RUN: FileCheck --check-prefix=O4_AND_O0 %s < %t
|
||||
|
||||
// O4_AND_O0: 0: input, "{{.*}}", c
|
||||
// O4_AND_O0: 1: preprocessor, {0}, cpp-output
|
||||
// O4_AND_O0: 2: compiler, {1}, assembler
|
||||
// O4_AND_O0: 3: assembler, {2}, object
|
|
@ -1,8 +1,6 @@
|
|||
// -flto and -O4 both cause a switch to llvm-bc object files.
|
||||
// -flto causes a switch to llvm-bc object files.
|
||||
// RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log
|
||||
// RUN: grep '2: compiler, {1}, lto-bc' %t.log
|
||||
// RUN: %clang -ccc-print-phases -c %s -O4 2> %t.log
|
||||
// RUN: grep '2: compiler, {1}, lto-bc' %t.log
|
||||
|
||||
// RUN: %clang -ccc-print-phases %s -flto 2> %t.log
|
||||
// RUN: grep '0: input, ".*lto.c", c' %t.log
|
||||
|
|
Loading…
Reference in New Issue