[cfe-commits] r146413 - in /cfe/trunk: include/clang/Basic/BuiltinsHexagon.def include/clang/Basic/LangOptions.def include/clang/Basic/TargetBuiltins.h include/clang/Driver/CC1Options.td include/clang/Driver/Options.td lib/Basic/Targets.cpp lib/C

Nick Lewycky nlewycky at google.com
Mon Dec 12 15:38:53 PST 2011


On 12 December 2011 13:14, Tony Linthicum <tlinth at codeaurora.org> wrote:
> Author: tlinth
> Date: Mon Dec 12 15:14:55 2011
> New Revision: 146413
>
> URL: http://llvm.org/viewvc/llvm-project?rev=146413&view=rev
> Log:
> Hexagon backend support

Congrats!

> +static const char *getHexagonTargetCPU(const ArgList &Args)
> +{
> +  Arg *A;
> +  llvm::StringRef WhichHexagon;
> +
> +  if ((A = getLastHexagonArchArg (Args))) {
> +    if ((A->getOption().matches(options::OPT_march_EQ)) ||
> +        (A->getOption().matches(options::OPT_mcpu_EQ))) {
> +      WhichHexagon = A->getValue(Args);
> +      if (WhichHexagon == "v2")
> +        return "hexagonv2";
> +      else if (WhichHexagon == "v3")
> +        return "hexagonv3";
> +      else if (WhichHexagon == "v4")
> +        return "hexagonv4";
> +      else
> +        assert (0 && "Unknown -march or -mcpu value");

Assert is not appropriate for verifying users options. Please use
"D.Diag(diag::err_drv_...) << ...".

Nick




More information about the cfe-commits mailing list