<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 23, 2016 at 5:51 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Feb 23, 2016 at 2:29 AM, Alexander Kornienko via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: alexfh<br>
Date: Tue Feb 23 04:29:04 2016<br>
New Revision: 261626<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=261626&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=261626&view=rev</a><br>
Log:<br>
Fix a -Wunused-variable diagnostic.<br>
<br>
Modified:<br>
    cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp<br>
<br>
Modified: cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp?rev=261626&r1=261625&r2=261626&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp?rev=261626&r1=261625&r2=261626&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp (original)<br>
+++ cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp Tue Feb 23 04:29:04 2016<br>
@@ -307,8 +307,10 @@ HasNameMatcher::HasNameMatcher(std::vect<br>
           N.begin(), N.end(),<br>
           [](StringRef Name) { return Name.find("::") == Name.npos; })),<br>
       Names(std::move(N)) {<br>
+#ifndef NDEBUG<br>
   for (StringRef Name : Names)<br>
     assert(!Name.empty());<br></blockquote><div><br></div></span><div>Alternatively, you could fold the loop into the assert:<br><br>assert(llvm::all_of(Names, [](StringRef Name) { return !Name.empty(); }));<br><br>(not sure if we have rangified llvm::all_of, but we have some of the other _of in llvm rangified versions and it would be easy to add this one too)</div></div></div></div></blockquote><div><br></div><div>Good to know we have rangified algorithms. However, I'll leave improvement of the code to the original author.</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_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+#endif<br>
 }<br>
<br>
 namespace {<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></span></div><br></div></div>
</blockquote></div><br></div></div>