<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 1, 2017 at 3:49 PM, Vedant Kumar via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@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"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Jun 1, 2017, at 1:49 PM, Craig Topper via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="m_4704396745231079492Apple-interchange-newline"><div><div dir="ltr">Adding cfe-dev</div><div class="gmail_extra"><br clear="all"><div><div class="m_4704396745231079492gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Thu, Jun 1, 2017 at 1:46 PM, Grang, Mandeep Singh via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF"><p>I see that the following test fails if reverse iteration of
      SmallPtrSet is enabled:</p><p><i>clang/test/SemaCXX/warn-loop-a<wbr>nalysis.cpp</i></p></div></blockquote></div></div></div></blockquote></span>I think I saw a bot complaining about this. Could you back out the change until these failures can be addressed? (Apologies if you already have.)<span class=""><br><br><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p>This is because in SemaStmt.cpp we iterate SmallPtrSet and output
      warnings about the variables not used in the loop.<br>
    </p><p>Expected output: <i>warning: variables 'i', 'j', and 'k' used in
        loop condition not modified</i></p><p>Output with reverse iteration: <i>warning: variables 'k', 'j',
        and 'i' used in loop condition not</i></p><p>I would like the community's opinion on whether this is something
      worth fixing? In this case, should the output always be the same
      irrespective of the iteration order?<br></p></div></blockquote></div></div></div></blockquote></span><div>Yes, I think so. Running the compiler twice should produce identical diagnostics.</div><span class=""><br><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p>
    </p><p> If yes, then we have 2 alternatives:</p><p>1. Change SmallPtrSet to SmallVector for the container (VarDecls)
      being iterated - this may have a compile time impact (need to
      measure).</p></div></blockquote></div></div></div></blockquote><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p>2. Sort the container (VarDecls) before iteration. We can sort
      based on decl source location and decl name. Not sure if these
      guaranteed to be unique?</p></div></blockquote></div></div></div></blockquote></span><span>CheckForLoopConditionalStateme<wbr>nt is hot, relative to the code that actually emits the diagnostic [1]. So </span>I'd prefer the second option.</div><div><br></div><div>[1] <a href="http://lab.llvm.org:8080/coverage/coverage-reports/clang/coverage/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/clang/lib/Sema/SemaStmt.cpp.html#L1454" target="_blank">http://lab.llvm.org:8080/<wbr>coverage/coverage-reports/<wbr>clang/coverage/Users/<wbr>buildslave/jenkins/<wbr>sharedspace/clang-stage2-<wbr>coverage-R@2/llvm/tools/clang/<wbr>lib/Sema/SemaStmt.cpp.html#<wbr>L1454</a></div></div></blockquote><div><br></div><div>Nice trick checking the coverage for a quick hotness check!</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>vedant<br><blockquote type="cite"><div><span class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><p>Thanks,</p><p>Mandeep<br>
    </p>
  </div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></span>
______________________________<wbr>_________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>