This refactors getHostCPUName so that for the architectures that get the
host cpu info on linux from /proc/cpuinfo, the /proc/cpuinfo parsing
logic is present in the build, even if it wasn't built on a linux system
for that architecture.
Since the code is present in the build, we can then test that code also
on other systems, i.e. we don't need to have buildbots setup for all
architectures on linux to be able to test this. Instead, developers will
test this as part of the regression test run.
As an example, a unit test is added to test getHostCPUName for a
Cortex-A9 processor running linux. A unit test is preferred over a
lit-based test, since the expectation is that in the future, the
functionality here will grow over what can be tested with "llc
-mcpu=native".
This is a preparation step to enable implementing the range of
improvements discussed on PR30516, such as adding AArch64 support,
support for big.LITTLE systems, reducing code duplication.
Capitalize 'helper' to make the comment prose.
Also, we more commonly use a 'detail' or 'internal' namespace. That would seem more consistent here.
And please follow the normal naming conventions rather than using a '_<arch>' suffix. Perhaps: getHostCPUNameForPowerPC, getHostCPUNameForARM, and getHostCPUNameForS390x.