From 02d03befb92d4613994a5be23effa5650116cf16 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 4 Oct 2016 21:00:57 +0000 Subject: [PATCH] clang-cl: Expose the -flto option 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 | 2 +- clang/test/Driver/cl-options.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 80ec594..d3de24b 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -815,7 +815,7 @@ def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group; -def flto : Flag<["-"], "flto">, Flags<[CC1Option]>, Group, +def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group, HelpText<"Enable LTO in 'full' mode">; def fno_lto : Flag<["-"], "fno-lto">, Group, HelpText<"Disable LTO mode (default)">; diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index 4e99ff8..ec0bd57 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -521,6 +521,7 @@ // RUN: -fmacro-backtrace-limit=0 \ // RUN: -fstandalone-debug \ // RUN: -flimit-debug-info \ +// RUN: -flto \ // RUN: -Werror /Zs -- %s 2>&1 -- 2.7.4