<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 27, 2015 at 1:29 PM Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> -    assert(Features[i][0] == '+' && "Invalid target feature!");<br>
> +    assert(Feature[0] == '+' && "Invalid target feature!");<br>
<br>
This assert is kind of pointless now, since we'll have continued in that<br>
case and the following code will DTRT anyway.<br>
<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>Was fairly pointless to begin with. I'll remove it :)</div></div></div></blockquote><div><br></div><div><div>dzur:~/sources/llvm/tools/clang> git svn dcommit </div><div>Committing to <a href="https://llvm.org/svn/llvm-project/cfe/trunk">https://llvm.org/svn/llvm-project/cfe/trunk</a> ...</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>M<span class="Apple-tab-span" style="white-space:pre">   </span>lib/Basic/Targets.cpp</div><div>Committed r246202</div></div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>-eric</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>      X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)<br>
> -      .Case("avx512f", AVX512F)<br>
> -      .Case("avx2", AVX2)<br>
> -      .Case("avx", AVX)<br>
> -      .Case("sse4.2", SSE42)<br>
> -      .Case("sse4.1", SSE41)<br>
> -      .Case("ssse3", SSSE3)<br>
> -      .Case("sse3", SSE3)<br>
> -      .Case("sse2", SSE2)<br>
> -      .Case("sse", SSE1)<br>
> +      .Case("+avx512f", AVX512F)<br>
> +      .Case("+avx2", AVX2)<br>
> +      .Case("+avx", AVX)<br>
> +      .Case("+sse4.2", SSE42)<br>
> +      .Case("+sse4.1", SSE41)<br>
> +      .Case("+ssse3", SSSE3)<br>
> +      .Case("+sse3", SSE3)<br>
> +      .Case("+sse2", SSE2)<br>
> +      .Case("+sse", SSE1)<br>
>        .Default(NoSSE);<br>
>      SSELevel = std::max(SSELevel, Level);<br>
><br>
>      MMX3DNowEnum ThreeDNowLevel =<br>
>        llvm::StringSwitch<MMX3DNowEnum>(Feature)<br>
> -        .Case("3dnowa", AMD3DNowAthlon)<br>
> -        .Case("3dnow", AMD3DNow)<br>
> -        .Case("mmx", MMX)<br>
> +        .Case("+3dnowa", AMD3DNowAthlon)<br>
> +        .Case("+3dnow", AMD3DNow)<br>
> +        .Case("+mmx", MMX)<br>
>          .Default(NoMMX3DNow);<br>
>      MMX3DNowLevel = std::max(MMX3DNowLevel, ThreeDNowLevel);<br>
><br>
>      XOPEnum XLevel = llvm::StringSwitch<XOPEnum>(Feature)<br>
> -        .Case("xop", XOP)<br>
> -        .Case("fma4", FMA4)<br>
> -        .Case("sse4a", SSE4A)<br>
> +        .Case("+xop", XOP)<br>
> +        .Case("+fma4", FMA4)<br>
> +        .Case("+sse4a", SSE4A)<br>
>          .Default(NoXOP);<br>
>      XOPLevel = std::max(XOPLevel, XLevel);<br>
>    }<br>
> @@ -5247,12 +5147,12 @@ public:<br>
>      FPU = FPUMode;<br>
>      CRC = 0;<br>
>      Crypto = 0;<br>
> -    for (unsigned i = 0, e = Features.size(); i != e; ++i) {<br>
> -      if (Features[i] == "+neon")<br>
> +    for (const auto &Feature : Features) {<br>
> +      if (Feature == "+neon")<br>
>          FPU = NeonMode;<br>
> -      if (Features[i] == "+crc")<br>
> +      if (Feature == "+crc")<br>
>          CRC = 1;<br>
> -      if (Features[i] == "+crypto")<br>
> +      if (Feature == "+crypto")<br>
>          Crypto = 1;<br>
>      }<br>
><br>
> @@ -5926,10 +5826,10 @@ public:<br>
>    bool handleTargetFeatures(std::vector<std::string> &Features,<br>
>                              DiagnosticsEngine &Diags) override {<br>
>      HasTransactionalExecution = false;<br>
> -    for (unsigned i = 0, e = Features.size(); i != e; ++i) {<br>
> -      if (Features[i] == "+transactional-execution")<br>
> +    for (const auto &Feature : Features) {<br>
> +      if (Feature == "+transactional-execution")<br>
>          HasTransactionalExecution = true;<br>
> -      if (Features[i] == "+vector")<br>
> +      else if (Feature == "+vector")<br>
>          HasVector = true;<br>
>      }<br>
>      // If we use the vector ABI, vector types are 64-bit aligned.<br>
> @@ -6477,29 +6377,28 @@ public:<br>
>      DspRev = NoDSP;<br>
>      HasFP64 = isFP64Default();<br>
><br>
> -    for (std::vector<std::string>::iterator it = Features.begin(),<br>
> -         ie = Features.end(); it != ie; ++it) {<br>
> -      if (*it == "+single-float")<br>
> +    for (const auto &Feature : Features) {<br>
> +      if (Feature == "+single-float")<br>
>          IsSingleFloat = true;<br>
> -      else if (*it == "+soft-float")<br>
> +      else if (Feature == "+soft-float")<br>
>          FloatABI = SoftFloat;<br>
> -      else if (*it == "+mips16")<br>
> +      else if (Feature == "+mips16")<br>
>          IsMips16 = true;<br>
> -      else if (*it == "+micromips")<br>
> +      else if (Feature == "+micromips")<br>
>          IsMicromips = true;<br>
> -      else if (*it == "+dsp")<br>
> +      else if (Feature == "+dsp")<br>
>          DspRev = std::max(DspRev, DSP1);<br>
> -      else if (*it == "+dspr2")<br>
> +      else if (Feature == "+dspr2")<br>
>          DspRev = std::max(DspRev, DSP2);<br>
> -      else if (*it == "+msa")<br>
> +      else if (Feature == "+msa")<br>
>          HasMSA = true;<br>
> -      else if (*it == "+fp64")<br>
> +      else if (Feature == "+fp64")<br>
>          HasFP64 = true;<br>
> -      else if (*it == "-fp64")<br>
> +      else if (Feature == "-fp64")<br>
>          HasFP64 = false;<br>
> -      else if (*it == "+nan2008")<br>
> +      else if (Feature == "+nan2008")<br>
>          IsNan2008 = true;<br>
> -      else if (*it == "-nan2008")<br>
> +      else if (Feature == "-nan2008")<br>
>          IsNan2008 = false;<br>
>      }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></blockquote></div></div>