Skip to content

Commit

Permalink
[FileCheck] Fix performance-for-range-copy issues. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Sep 27, 2023
1 parent d87f9e2 commit ab3e647
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/utils/FileCheck/FileCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ BuildInputAnnotations(const SourceMgr &SM, unsigned CheckFileBufferID,
};
// How many diagnostics does each pattern have?
std::map<SMLoc, unsigned, CompareSMLoc> DiagCountPerPattern;
for (auto Diag : Diags)
for (const FileCheckDiag &Diag : Diags)
++DiagCountPerPattern[Diag.CheckLoc];
// How many diagnostics have we seen so far per pattern?
std::map<SMLoc, unsigned, CompareSMLoc> DiagIndexPerPattern;
Expand Down Expand Up @@ -673,7 +673,7 @@ static void DumpAnnotatedInput(raw_ostream &OS, const FileCheckRequest &Req,
for (unsigned Col = 1; InputFilePtr != InputFileEnd && !Newline; ++Col) {
bool WasInMatch = InMatch;
InMatch = false;
for (auto M : FoundAndExpectedMatches) {
for (const InputAnnotation &M : FoundAndExpectedMatches) {
if (M.InputStartCol <= Col && Col < M.InputEndCol) {
InMatch = true;
break;
Expand Down

0 comments on commit ab3e647

Please sign in to comment.