Fix up handling of ARM options for controlling strict alignment.
authorBob Wilson <bob.wilson@apple.com>
Tue, 29 Jul 2014 00:23:18 +0000 (00:23 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 29 Jul 2014 00:23:18 +0000 (00:23 +0000)
commit0874e538aaeaab95b23dc751911a2b121e9fa320
treeb502439e1e29f4ee1a95b20b4bd03a9d3a0672ad
parent57e74d2010d7c82cb831350968df3a69bbe5a38e
Fix up handling of ARM options for controlling strict alignment.

The -mstrict-align option was originally added in r167619 as a target-
independent option. It was then changed in r167623 to be implemented with an
ARM-specific backend option, even though the code remained in the
target-independent Clang::ConstructJob function. This means that if you used
the -mstrict-align option with a non-ARM target, you would still get the
-arm-strict-align option getting passed to the backend, which was harmless
but gross. The driver option was then replaced by the GCC-compatible
-m[no-]unaligned-access option (r189175) and modified to work with AArch64
(r208075). However, in the process, the help text for -mstrict-align was
incorrectly changed to show it as only being supported for AArch64. Even worse,
the logic for handling these options together with -mkernel was wrong for
AArch64, where -mkernel does not currently imply strict alignment.

This patch fixes up all of those things. Besides the obvious change to the
option help text, it moves the logic into the ARM and AArch64-specific parts
of the driver, so that the option will be correctly ignored for non-ARM
targets. <rdar://problem/17823697>

llvm-svn: 214148
clang/include/clang/Driver/Options.td
clang/lib/Driver/Tools.cpp
clang/test/Driver/arm-alignment.c