This series also fixes a couple of minor bugs (see 01/11 and 11/11). The aim of the refactor is to get all of the target parsing logic (whether via command line options, or attributes) into a single location with as much code regularity and reuse as is reasonably possible. This includes reordering functions so that each group of functions covers (where applicable) "extensions", "arch", "cpu" and "tune", in that order.
I considered whether it might be possible to further combine the error handling for command line parsing and attribute parsing, but concluded that the functions were sufficiently disimilar to justify their separation. The patch series also ensures that all target strings passed to the assembler pass through the same canonicalisation, regardless of which part of the driver or compiler emits them. Previously the -march driver flag was passed directly to the assembler; this would only have been an issue when using `-march=...+aes+sha2` (or similar) in the driver's options with an old assembler version. Each commit has been built and tested with: RUNTESTFLAGS="aarch64.exp=feature-*\ spellcheck*\ mv*\ arch-diag*\ cpu-diag*\ target_attr_crypto_ice*\ aarch64-cpunative.exp=* dg.exp=march.c\ mtune.c" Additionally, I'm currently rerunning bootstrap/regression testing on the whole series. Ok for master if regression testing passes?