[Mlir-commits] [mlir] 392d03f - [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in TranslateToCpp.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Sep 1 02:18:16 PDT 2025


Author: Mehdi Amini
Date: 2025-09-01T02:17:00-07:00
New Revision: 392d03f3385d46613600c4e3c1ec4f3c71ea725b

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

LOG: [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in TranslateToCpp.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Target/Cpp/TranslateToCpp.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
index 7284e24776175..68830a1b8da2b 100644
--- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp
+++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
@@ -35,7 +35,7 @@ using llvm::formatv;
 /// on each element doesn't return a string.
 template <typename ForwardIterator, typename UnaryFunctor,
           typename NullaryFunctor>
-inline LogicalResult
+static inline LogicalResult
 interleaveWithError(ForwardIterator begin, ForwardIterator end,
                     UnaryFunctor eachFn, NullaryFunctor betweenFn) {
   if (begin == end)
@@ -52,16 +52,16 @@ interleaveWithError(ForwardIterator begin, ForwardIterator end,
 }
 
 template <typename Container, typename UnaryFunctor, typename NullaryFunctor>
-inline LogicalResult interleaveWithError(const Container &c,
-                                         UnaryFunctor eachFn,
-                                         NullaryFunctor betweenFn) {
+static inline LogicalResult interleaveWithError(const Container &c,
+                                                UnaryFunctor eachFn,
+                                                NullaryFunctor betweenFn) {
   return interleaveWithError(c.begin(), c.end(), eachFn, betweenFn);
 }
 
 template <typename Container, typename UnaryFunctor>
-inline LogicalResult interleaveCommaWithError(const Container &c,
-                                              raw_ostream &os,
-                                              UnaryFunctor eachFn) {
+static inline LogicalResult interleaveCommaWithError(const Container &c,
+                                                     raw_ostream &os,
+                                                     UnaryFunctor eachFn) {
   return interleaveWithError(c.begin(), c.end(), eachFn, [&]() { os << ", "; });
 }
 
@@ -1787,7 +1787,7 @@ LogicalResult CppEmitter::emitType(Location loc, Type type) {
     case 16: {
       if (llvm::isa<Float16Type>(type))
         return (os << "_Float16"), success();
-      else if (llvm::isa<BFloat16Type>(type))
+      if (llvm::isa<BFloat16Type>(type))
         return (os << "__bf16"), success();
       else
         return emitError(loc, "cannot emit float type ") << type;


        


More information about the Mlir-commits mailing list