[llvm-dev] LLVM issuse:AArch64 TargetParser

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Mon May 9 01:39:13 PDT 2016

On 9 May 2016 at 09:19, Jojo Ma <jojo.ma at linaro.org> wrote:
> +//Only if -march startwith "armv" or "v" or "iwmmxt" or "xscale",it can be
> seen valid and sended to TargetParser
> +//for further parsing
> +static bool checkArchValid(StringRef Arch)
> +{
> +  if ((Arch.startswith("armv")) || Arch[0] == 'v' ||
> +         (Arch.startswith("iwmmxt")) || (Arch.startswith("xscale")))
> +    return true;
> +  return false;
> +}

Hi Jojo,

With the TargetParser, the idea is to avoid that specific knowledge on
the tools themselves, and moving all string parsing (startswith,
StringSwitch) to the parser.

But that creates the conundrum that we've seen, that we can't parse it
uniquely without more context. It also seems that we need the Triple
to be able to infer anything about march. That is the logic that needs
to be in Clang, not the string parsing.

Another alternative would be to create two checkValid functions, one
explicitly for ARM and one for AArch64, and call them from different
places in Clang.

Hope that helps.


More information about the llvm-dev mailing list