[llvm] df5ef76 - [IR] PatternMatch.h - m_SplatOrUndefMask::match - specialise auto to const auto*

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 10:04:11 PST 2023


Author: Simon Pilgrim
Date: 2023-01-29T18:03:53Z
New Revision: df5ef761d4e7fae85fa38f396523f2dab7ddb388

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

LOG: [IR] PatternMatch.h - m_SplatOrUndefMask::match - specialise auto to const auto*

Fixes clang-tidy warning

Added: 
    

Modified: 
    llvm/include/llvm/IR/PatternMatch.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index 38a916cccace..8b542b79f8ea 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -1536,7 +1536,7 @@ struct m_SplatOrUndefMask {
   int &SplatIndex;
   m_SplatOrUndefMask(int &SplatIndex) : SplatIndex(SplatIndex) {}
   bool match(ArrayRef<int> Mask) {
-    auto First = find_if(Mask, [](int Elem) { return Elem != -1; });
+    const auto *First = find_if(Mask, [](int Elem) { return Elem != -1; });
     if (First == Mask.end())
       return false;
     SplatIndex = *First;


        


More information about the llvm-commits mailing list