[LTO] Add option to enable LTOUnit splitting, and disable unless needed
authorTeresa Johnson <tejohnson@google.com>
Fri, 11 Jan 2019 18:32:07 +0000 (18:32 +0000)
committerTeresa Johnson <tejohnson@google.com>
Fri, 11 Jan 2019 18:32:07 +0000 (18:32 +0000)
commit84cecfcb3db7c3275ae2d64c419a752d9f5311d6
tree137b550e0763b8685551711c9a6829e232870ba6
parent290a8398917a3d4ef521a0cfdb67e65238f0043a
[LTO] Add option to enable LTOUnit splitting, and disable unless needed

Summary:
Adds a new -f[no]split-lto-unit flag that is disabled by default to
control module splitting during ThinLTO. It is automatically enabled
for -fsanitize=cfi and -fwhole-program-vtables.

The new EnableSplitLTOUnit codegen flag is passed down to llvm
via a new module flag of the same name.

Depends on D53890.

Reviewers: pcc

Subscribers: ormris, mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D53891

llvm-svn: 350949
12 files changed:
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/SanitizerArgs.h
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
clang/test/CodeGen/thinlto-distributed-cfi.ll
clang/test/CodeGenCXX/no-lto-unit.cpp
clang/test/CodeGenCXX/type-metadata-thinlto.cpp
clang/test/Driver/split-lto-unit.c [new file with mode: 0644]