summaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-10-01 18:08:29 +0000
committerTeresa Johnson <tejohnson@google.com>2019-10-01 18:08:29 +0000
commit1d71a6cd62cafcc4e29884e0a20d5fb2826fe6b7 (patch)
treea508d55c76c012d5338f3b39f410f12b3bb53d62 /lib/Driver/ToolChains
parent32e6e8415c2ce1dbaea4c754d65ccd53e43a4ec9 (diff)
downloadclang-1d71a6cd62cafcc4e29884e0a20d5fb2826fe6b7.tar.gz
[ThinLTO] Enable index-only WPD from clang
Summary: To trigger the index-only Whole Program Devirt support added to LLVM, we need to be able to specify -fno-split-lto-unit in conjunction with -fwhole-program-vtables. Keep the default for -fwhole-program-vtables as -fsplit-lto-unit, but don't error on that option combination. Reviewers: pcc Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68029 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains')
-rw-r--r--lib/Driver/ToolChains/Clang.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp
index 309ce7fdc7..8628741f7d 100644
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -5456,14 +5456,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fwhole-program-vtables");
}
- bool RequiresSplitLTOUnit = WholeProgramVTables || Sanitize.needsLTO();
+ bool DefaultsSplitLTOUnit = WholeProgramVTables || Sanitize.needsLTO();
bool SplitLTOUnit =
Args.hasFlag(options::OPT_fsplit_lto_unit,
- options::OPT_fno_split_lto_unit, RequiresSplitLTOUnit);
- if (RequiresSplitLTOUnit && !SplitLTOUnit)
- D.Diag(diag::err_drv_argument_not_allowed_with)
- << "-fno-split-lto-unit"
- << (WholeProgramVTables ? "-fwhole-program-vtables" : "-fsanitize=cfi");
+ options::OPT_fno_split_lto_unit, DefaultsSplitLTOUnit);
+ if (Sanitize.needsLTO() && !SplitLTOUnit)
+ D.Diag(diag::err_drv_argument_not_allowed_with) << "-fno-split-lto-unit"
+ << "-fsanitize=cfi";
if (SplitLTOUnit)
CmdArgs.push_back("-fsplit-lto-unit");