While working on D118450, I noticed that sys::getHostCPUName lacks SPARC support.
This patch implements it. The code is taken from/inspired by GCC's gcc/config/sparc/driver-sparc.cc. There's one caveat: since LLVM, unlike GCC, doesn't support the SPARC-M7, -S7, and -M8 CPUs, I map all those to the latest supported one (UltraSparc T5/niagara4).
Tested on sparcv9-sun-solaris2.11 and sparc64-unknown-linux-gnu by running savcov --version on
- Netra SPARC S7-2 (SPARC-S7, Solaris 11.4)
- SPARC T5-2 (SPARC T5, Solaris 11.4)
- SPARC Enterprise T5220 (UltraSPARC T2, Solaris 11.3)
- SPARC T5 (UltraSPARC T5, Debian sid)
- SPARC T3 (UltraSPARC T3, Debian sid)