Permit attribute 'used' with 'target' multiversioning.
authorErich Keane <erich.keane@intel.com>
Mon, 9 Mar 2020 17:15:45 +0000 (10:15 -0700)
committerErich Keane <erich.keane@intel.com>
Mon, 9 Mar 2020 19:38:03 +0000 (12:38 -0700)
commitcc8390bfe30d08633d62a1b53e6669e386c95600
treea6eb04f0cb61938d21ab0d8bfc852e0c3d5a3ea7
parent209094eeb6c64cf515e24844f7420f93083e5dd4
Permit attribute 'used' with 'target' multiversioning.

This adds infrastructure for a multiversioning whitelist, plus adds
'used' to the allowed list with 'target'.  The behavior here mirrors the
implementation in GCC, where 'used' only applies to the single
declaration and doesn't apply to the ifunc or resolver.

This is not being applied to cpu_dispatch and cpu_specific, since the
rules are more complicated for cpu_specific, which emits multiple
symbols. Additionally, the author isn't currently aware of uses in the
wild of this combination, but is aware of a number of target+used
combinations.
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGen/attr-target-mv.c
clang/test/Sema/attr-target-mv.c