[AArch64] Pass subtarget feature "+strict-align".
This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.
rdar://problem/21529937
llvm-svn: 243518
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index f554cae..bd8f25f6 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -983,15 +983,6 @@
CmdArgs.push_back("-target-abi");
CmdArgs.push_back(ABIName);
- if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
- options::OPT_munaligned_access)) {
- CmdArgs.push_back("-backend-option");
- if (A->getOption().matches(options::OPT_mno_unaligned_access))
- CmdArgs.push_back("-aarch64-strict-align");
- else
- CmdArgs.push_back("-aarch64-no-strict-align");
- }
-
if (Arg *A = Args.getLastArg(options::OPT_mfix_cortex_a53_835769,
options::OPT_mno_fix_cortex_a53_835769)) {
CmdArgs.push_back("-backend-option");
@@ -2068,6 +2059,11 @@
Features.push_back("-crc");
}
+ if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
+ options::OPT_munaligned_access))
+ if (A->getOption().matches(options::OPT_mno_unaligned_access))
+ Features.push_back("+strict-align");
+
if (Args.hasArg(options::OPT_ffixed_x18) || Triple.isOSDarwin())
Features.push_back("+reserve-x18");
}