OSDN Git Service

[Driver][X86] Support branch align options with LTO
authorShengchen Kan <shengchen.kan@intel.com>
Mon, 25 May 2020 02:18:44 +0000 (10:18 +0800)
committerShengchen Kan <shengchen.kan@intel.com>
Thu, 28 May 2020 05:17:14 +0000 (13:17 +0800)
commit49544499954912c5a0f02014de53e0bc0234c7af
tree9ced214629ec32141189e8c141076b42d41562d9
parentc1d5b831b1cb095370a01e1749a8e9746f8f3de6
[Driver][X86] Support branch align options with LTO

Summary: Before this patch, we use two different ways to pass options to align branch
depending on whether LTO is enabled. For example, `-mbranches-within-32B-boundaries`
w/o LTO and `-Wl,-plugin-opt=-x86-branches-within-32B-boundaries` w/ LTO.  It's
inconvenient, so this patch unifies the way: we only need to pass options like
`-mbranches-within-32B-boundaries` to align branches, no matter LTO is enabled or not.

Differential Revision: https://reviews.llvm.org/D80289
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/CommonArgs.h
clang/test/Driver/x86-malign-branch.c