clang-cl: Expose the -flto option
authorHans Wennborg <hans@hanshq.net>
Tue, 4 Oct 2016 21:00:57 +0000 (21:00 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 4 Oct 2016 21:00:57 +0000 (21:00 +0000)
We could hook up /GL as an alias for -flto, but that might be
confusing, as clang-cl in that mode would not be drop-in compatible
with cl.exe /GL, as it requires the linker to be lld.

Exposing -flto seems like a less confusing way to expose this
functionality.

llvm-svn: 283255

clang/include/clang/Driver/Options.td
clang/test/Driver/cl-options.c

index 80ec594..d3de24b 100644 (file)
@@ -815,7 +815,7 @@ def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Gr
 def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
 def flto_EQ : Joined<["-"], "flto=">, Flags<[CC1Option]>, Group<f_Group>,
   HelpText<"Set LTO mode to either 'full' or 'thin'">;
-def flto : Flag<["-"], "flto">, Flags<[CC1Option]>, Group<f_Group>,
+def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
   HelpText<"Enable LTO in 'full' mode">;
 def fno_lto : Flag<["-"], "fno-lto">, Group<f_Group>,
   HelpText<"Disable LTO mode (default)">;
index 4e99ff8..ec0bd57 100644 (file)
 // RUN:     -fmacro-backtrace-limit=0 \
 // RUN:     -fstandalone-debug \
 // RUN:     -flimit-debug-info \
+// RUN:     -flto \
 // RUN:     -Werror /Zs -- %s 2>&1