[PATCH] D14471: [AArch64] Fix a crash in driver

Renato Golin via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 13 01:23:37 PST 2015


rengolin added a comment.

In http://reviews.llvm.org/D14471#288621, @ahatanak wrote:

> In getAArch64TargetCPU, if it finds out the cpu name passed via -mtune or -mcpu is "native",
>
> 1. Call llvm::sys::getHostCPUName to get the host CPU name.
> 2. Check the host CPU name to see if it is a valid AArch64 CPU. A CPU is valid if it is one of these CPUs: cyclone, cortex-a53, cortex-a57, cortex-a72, or generic (this is the set of CPUs that are valid in DecodeAArch64Mcpu).
> 3. If the host CPU is valid, return the CPU name. Otherwise, return "native".


Something like that, yes. Only return native if -mcpu/tune was native to begin with, and decode CPU names using the already existing mechanisms, not creating a new StringSwitch.

thanks,
--renato


http://reviews.llvm.org/D14471





More information about the cfe-commits mailing list