<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Sounds good to me. Thanks for pushing on this!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 8, 2021 at 4:47 AM Salman Javed via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">salman-javed-nz added a comment.<br>
<br>
Hi, just giving a progress update. This is just a early heads-up - no action needed from you at this stage.<br>
<br>
I have a rough prototype that seems promising. The big-O/time complexity is no longer dependent on the number of headers being included and the number of diagnostics being raised. I need to tidy up and refactor the code before sharing with you but to give an early indication of the path I'm taking, it's essentially:<br>
<br>
  struct NolintBlock {<br>
    SourceLocation BeginLoc;<br>
    SourceLocation EndLoc;<br>
    std::string Checks;<br>
  };<br>
<br>
  // Need to keep a cache of every NOLINT block seen, not only in the current file<br>
  // but in any other file seen during this run of the program. We may be context<br>
  // switching between files (if there is a check violation in a macro in an<br>
  // #included file, for instance), and we don't want to be starting from scratch<br>
  // each time.<br>
  some_kind_of_map<FileID, SmallVector<NolintBlock>> NolintBlocks;<br>
  // Performance of each type of map class is still to be evaluated...<br>
<br>
  bool lineIsMarkedWithNOLINT(/* ... */) {<br>
    // These two `if` statements will more or less be the same as they are now:<br>
    //   If NOLINT statement found on this line, return true<br>
    //   If NOLINTNEXTLINE statement found on previous line, return true<br>
<br>
    // If no cache for the file exists, generate it (warning: heavy operation)<br>
<br>
    // For NolintBlock in NolintBlocks[FileID]:<br>
    //   if NolintBlock.StartLoc < Loc < NolintBlock.EndLoc:<br>
    //      return true<br>
    // Return false<br>
  }<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D108560/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D108560/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D108560" rel="noreferrer" target="_blank">https://reviews.llvm.org/D108560</a><br>
<br>
</blockquote></div>