LTO isn't working in Morbo. Convert the -O4 to -O3 and ignore the -flto flag.
<rdar://problem/10299475>

llvm-svn: 142865
diff --git a/llvm-gcc-4.2/gcc/doc/invoke.texi b/llvm-gcc-4.2/gcc/doc/invoke.texi
index 7cf94ef..975765c 100644
--- a/llvm-gcc-4.2/gcc/doc/invoke.texi
+++ b/llvm-gcc-4.2/gcc/doc/invoke.texi
@@ -433,7 +433,7 @@
 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
 --param @var{name}=@var{value}
 @c LLVM LOCAL -fast, -Oz,
--flto (APPLE ONLY) -O  -O0  -O1  -O2  -O3 -O4 (APPLE ONLY) -Os -Oz (APPLE ONLY) -fast (APPLE ONLY)}
+(APPLE ONLY) -O  -O0  -O1  -O2  -O3 (APPLE ONLY) -Os -Oz (APPLE ONLY) -fast (APPLE ONLY)}
 
 @item Preprocessor Options
 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
@@ -5156,17 +5156,6 @@
 @option{-O2} and also turns on the @option{-finline-functions},
 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
 
-@c LLVM LOCAL begin
-@item -flto
-@opindex flto
-Enable LLVM Link Time Optimization. 
-
-@item -O4
-@opindex O4
-Enable LLVM Link Time Optimization. @option{-O4} turns on all LLVM compile
-time optimizations specified by @option{-O2}.
-@c LLVM LOCAL end
-
 @item -O0
 @opindex O0
 Do not optimize.  This is the default.
diff --git a/llvm-gcc-4.2/gcc/doc/llvm-gcc.1 b/llvm-gcc-4.2/gcc/doc/llvm-gcc.1
index 7e09f1c..f9278b4 100644
--- a/llvm-gcc-4.2/gcc/doc/llvm-gcc.1
+++ b/llvm-gcc-4.2/gcc/doc/llvm-gcc.1
@@ -23,10 +23,6 @@
 llvm-gcc is a C, C++, Objective-C and Objective-C++ compiler. llvm-g++ is a compiler driver for C++. llvm-gcc uses gcc front-end and gcc's command line interface. Consult the cc(1) man page for command line options supported by llvm-gcc. Only selected LLVM specific options are listed here.
 .Pp
 .Bl -tag -width -indent
-.It Fl flto
-Enables Link Time Optimization. Link Time Optimization is performed by ld(1) transparently using the LLVM optimizer. The object file generated contains intermediate LLVM bitcode instead of Mach-O objects.
-.It Fl O4
-Enables Link Time Optimization in addition to all optimizations enabled at -O3.
 .It Fl O
 Unlike gcc, -O means -O2 instead of -O1.
 .El
diff --git a/llvm-gcc-4.2/gcc/gcc.c b/llvm-gcc-4.2/gcc/gcc.c
index 3cc86c3..ebf7401 100644
--- a/llvm-gcc-4.2/gcc/gcc.c
+++ b/llvm-gcc-4.2/gcc/gcc.c
@@ -840,10 +840,12 @@
 /* LLVM LOCAL begin */
 static const char *llvm_options =
 #ifdef ENABLE_LLVM
-"%{O4|emit-llvm|flto:%{S:-emit-llvm} \
-                     %{!S:-emit-llvm-bc \
-                     %{c: %W{o*} %{!o*:-o %b%w.o}} \
-                     %{!c:-o %d%w%u%O}}}"
+"%{O4:-O3}%<O4\
+ %<flto\
+ %{emit-llvm:%{S:-emit-llvm}\
+             %{!S:-emit-llvm-bc\
+             %{c: %W{o*} %{!o*:-o %b%w.o}}\
+             %{!c:-o %d%w%u%O}}}"
 #else
   "%{emit-llvm:%e--emit-llvm is not supported in this configuration.}"
 #endif
@@ -860,7 +862,7 @@
 "/* LLVM LOCAL */"\
  %1 %{!Q:-quiet} -dumpbase %B %{d*} %{Zmllvm*: -mllvm %*} %{m*} %{a*}\
  %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
- %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
+ %{g*} %{!O4:%{O*}} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
  %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
  %{Qn:-fno-ident} %{--help:--help}\
  %{--target-help:--target-help}\