[llvm] ab3e647 - [FileCheck] Fix performance-for-range-copy issues. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 13:34:46 PDT 2023


Author: Fangrui Song
Date: 2023-09-27T13:34:41-07:00
New Revision: ab3e647b893e1063838a7aff5477c53338992558

URL: https://github.com/llvm/llvm-project/commit/ab3e647b893e1063838a7aff5477c53338992558
DIFF: https://github.com/llvm/llvm-project/commit/ab3e647b893e1063838a7aff5477c53338992558.diff

LOG: [FileCheck] Fix performance-for-range-copy issues. NFC

Added: 
    

Modified: 
    llvm/utils/FileCheck/FileCheck.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 6657a1aff3975e5..5f85f4f75d13a97 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -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;
@@ -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;


        


More information about the llvm-commits mailing list