aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2022-11-08 19:30:26 +0000
committerDavid Green <david.green@arm.com>2022-11-08 19:30:26 +0000
commitf0e6c403c2d399e4fd821aa5a7e4a20534494c71 (patch)
tree8b22eb7913259d36cd84aa5c9bdf0c21ca1177e7 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent9e956995db1fc7e792e3dfb3a465a52626195557 (diff)
downloadllvm-f0e6c403c2d399e4fd821aa5a7e4a20534494c71.zip
llvm-f0e6c403c2d399e4fd821aa5a7e4a20534494c71.tar.gz
llvm-f0e6c403c2d399e4fd821aa5a7e4a20534494c71.tar.bz2
[AArch64] Allow users-facing feature names in clang target attributes
D133848 added support for the GCC format of target("..") attributes. The supported formats to match gcc are: // "arch=<arch>" - parsed to features as per -march=.. // "cpu=<cpu>" - parsed to features as per -mcpu=.., with CPU set to <cpu> // "tune=<cpu>" - TuneCPU set to <cpu> // "+feature", "+nofeature" - Add (or remove) feature. We also support the existing formats, previously accepted by clang, for compatibility with the existing code and intrinsics code: // "feature", "no-feature" - Add (or remove) feature. The clang formats would accept and use internal feature names ("fullfp16"/"neon"/"sve") as opposed to the user facing names ("fp16"/"simd"/"sve"). Usually they use the same names, but can be different for cases like fp, fullfp16 and mte (among others). This patch makes the clang format also except the user facing names, by parsing the features through getArchExtFeature. There is a fallback if the name is not recognized (like "fullfp16"), where we add the existing string which should then be checked later for consistency. This allows the internal names to be used as before, so long as they are recognized as internal names. (Note that we currently don't have an implementation of isValidFeatureName. The backend will currently give an error like "'-sid' is not a recognized feature for this target (ignoring feature)." This should be improved in a later patch once an implementation of isValidFeatureName in clang is present). Differential Revision: https://reviews.llvm.org/D137617
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions