Make helpers static. NFC.
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index d305527..2e30a3b 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -296,8 +296,8 @@
   return true;
 }
 
-llvm::Optional<StringRef> getBuffer(const SourceManager &SM, FileID File,
-                                    bool AllowIO) {
+static llvm::Optional<StringRef> getBuffer(const SourceManager &SM, FileID File,
+                                           bool AllowIO) {
   // This is similar to the implementation of SourceManager::getBufferData(),
   // but uses ContentCache::getRawBuffer() rather than getBuffer() if
   // AllowIO=false, to avoid triggering file I/O if the file contents aren't
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 8cf2a03..afe8ef4 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -829,7 +829,7 @@
   return dwarf->getDILineInfo(offset, sectionIndex);
 }
 
-StringRef ltrim1(StringRef s, const char *chars) {
+static StringRef ltrim1(StringRef s, const char *chars) {
   if (!s.empty() && strchr(chars, s[0]))
     return s.substr(1);
   return s;
diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 077b34c..24dcf73 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -862,7 +862,7 @@
 }
 
 template <typename PoolingOp>
-LogicalResult verifySingleInputPoolingOp(PoolingOp op) {
+static LogicalResult verifySingleInputPoolingOp(PoolingOp op) {
   auto inputType = op.input().getType().template cast<MemRefType>();
   auto outputType = op.output().getType().template cast<MemRefType>();
   if (outputType.getElementType() != inputType.getElementType())