[Mlir-commits] [mlir] d19f89b - Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Jan 13 18:27:53 PST 2022


Author: Mehdi Amini
Date: 2022-01-14T02:26:26Z
New Revision: d19f89b5d2a97e1f873eebd077191830c7c41ad3

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

LOG: Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC)

Added: 
    

Modified: 
    mlir/include/mlir/IR/AffineExpr.h
    mlir/include/mlir/IR/AffineMap.h
    mlir/include/mlir/IR/Attributes.h
    mlir/include/mlir/IR/Location.h
    mlir/include/mlir/IR/Matchers.h
    mlir/include/mlir/IR/Types.h
    mlir/include/mlir/Support/InterfaceSupport.h
    mlir/lib/IR/AttributeDetail.h
    mlir/lib/IR/TypeDetail.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h
index 01ac2d713820f..5ede7c7d123a3 100644
--- a/mlir/include/mlir/IR/AffineExpr.h
+++ b/mlir/include/mlir/IR/AffineExpr.h
@@ -344,11 +344,11 @@ namespace llvm {
 template <>
 struct DenseMapInfo<mlir::AffineExpr> {
   static mlir::AffineExpr getEmptyKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
     return mlir::AffineExpr(static_cast<mlir::AffineExpr::ImplType *>(pointer));
   }
   static mlir::AffineExpr getTombstoneKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
     return mlir::AffineExpr(static_cast<mlir::AffineExpr::ImplType *>(pointer));
   }
   static unsigned getHashValue(mlir::AffineExpr val) {

diff  --git a/mlir/include/mlir/IR/AffineMap.h b/mlir/include/mlir/IR/AffineMap.h
index 316e082a45fc0..fb923b5970b85 100644
--- a/mlir/include/mlir/IR/AffineMap.h
+++ b/mlir/include/mlir/IR/AffineMap.h
@@ -575,11 +575,11 @@ namespace llvm {
 template <>
 struct DenseMapInfo<mlir::AffineMap> {
   static mlir::AffineMap getEmptyKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
     return mlir::AffineMap(static_cast<mlir::AffineMap::ImplType *>(pointer));
   }
   static mlir::AffineMap getTombstoneKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
     return mlir::AffineMap(static_cast<mlir::AffineMap::ImplType *>(pointer));
   }
   static unsigned getHashValue(mlir::AffineMap val) {

diff  --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h
index d39eb54f775c7..739493486258d 100644
--- a/mlir/include/mlir/IR/Attributes.h
+++ b/mlir/include/mlir/IR/Attributes.h
@@ -231,11 +231,11 @@ namespace llvm {
 // Attribute hash just like pointers.
 template <> struct DenseMapInfo<mlir::Attribute> {
   static mlir::Attribute getEmptyKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
     return mlir::Attribute(static_cast<mlir::Attribute::ImplType *>(pointer));
   }
   static mlir::Attribute getTombstoneKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
     return mlir::Attribute(static_cast<mlir::Attribute::ImplType *>(pointer));
   }
   static unsigned getHashValue(mlir::Attribute val) {

diff  --git a/mlir/include/mlir/IR/Location.h b/mlir/include/mlir/IR/Location.h
index 76ae7a48a3cbd..4a3f22e8eea53 100644
--- a/mlir/include/mlir/IR/Location.h
+++ b/mlir/include/mlir/IR/Location.h
@@ -130,11 +130,11 @@ namespace llvm {
 // Type hash just like pointers.
 template <> struct DenseMapInfo<mlir::Location> {
   static mlir::Location getEmptyKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
     return mlir::Location::getFromOpaquePointer(pointer);
   }
   static mlir::Location getTombstoneKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
     return mlir::Location::getFromOpaquePointer(pointer);
   }
   static unsigned getHashValue(mlir::Location val) {

diff  --git a/mlir/include/mlir/IR/Matchers.h b/mlir/include/mlir/IR/Matchers.h
index da313a2f2f9be..78c65f8cce301 100644
--- a/mlir/include/mlir/IR/Matchers.h
+++ b/mlir/include/mlir/IR/Matchers.h
@@ -166,7 +166,7 @@ typename std::enable_if_t<
                       Operation *>::value,
     bool>
 matchOperandOrValueAtIndex(Operation *op, unsigned idx, MatcherClass &matcher) {
-  if (auto defOp = op->getOperand(idx).getDefiningOp())
+  if (auto *defOp = op->getOperand(idx).getDefiningOp())
     return matcher.match(defOp);
   return false;
 }

diff  --git a/mlir/include/mlir/IR/Types.h b/mlir/include/mlir/IR/Types.h
index 8c828413038cd..35135d6ca2ab6 100644
--- a/mlir/include/mlir/IR/Types.h
+++ b/mlir/include/mlir/IR/Types.h
@@ -259,11 +259,11 @@ namespace llvm {
 // Type hash just like pointers.
 template <> struct DenseMapInfo<mlir::Type> {
   static mlir::Type getEmptyKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getEmptyKey();
     return mlir::Type(static_cast<mlir::Type::ImplType *>(pointer));
   }
   static mlir::Type getTombstoneKey() {
-    auto pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
+    auto *pointer = llvm::DenseMapInfo<void *>::getTombstoneKey();
     return mlir::Type(static_cast<mlir::Type::ImplType *>(pointer));
   }
   static unsigned getHashValue(mlir::Type val) { return mlir::hash_value(val); }

diff  --git a/mlir/include/mlir/Support/InterfaceSupport.h b/mlir/include/mlir/Support/InterfaceSupport.h
index 92103fd2f171f..53caebcaee69f 100644
--- a/mlir/include/mlir/Support/InterfaceSupport.h
+++ b/mlir/include/mlir/Support/InterfaceSupport.h
@@ -260,9 +260,10 @@ class InterfaceMap {
   /// Returns an instance of the concept object for the given interface id if it
   /// was registered to this map, null otherwise.
   void *lookup(TypeID id) const {
-    auto it = llvm::lower_bound(interfaces, id, [](const auto &it, TypeID id) {
-      return compare(it.first, id);
-    });
+    const auto *it =
+        llvm::lower_bound(interfaces, id, [](const auto &it, TypeID id) {
+          return compare(it.first, id);
+        });
     return (it != interfaces.end() && it->first == id) ? it->second : nullptr;
   }
 

diff  --git a/mlir/lib/IR/AttributeDetail.h b/mlir/lib/IR/AttributeDetail.h
index 630040229acb7..747d7275d75c8 100644
--- a/mlir/lib/IR/AttributeDetail.h
+++ b/mlir/lib/IR/AttributeDetail.h
@@ -300,7 +300,7 @@ struct DenseStringElementsAttrStorage : public DenseElementsAttributeStorage {
     // contents.
     auto mutableCopy = MutableArrayRef<StringRef>(
         reinterpret_cast<StringRef *>(rawData), numEntries);
-    auto stringData = rawData + numEntries * sizeof(StringRef);
+    auto *stringData = rawData + numEntries * sizeof(StringRef);
 
     for (int i = 0; i < numEntries; i++) {
       memcpy(stringData, data[i].data(), data[i].size());

diff  --git a/mlir/lib/IR/TypeDetail.h b/mlir/lib/IR/TypeDetail.h
index c1079a468c4af..1ae66555715f7 100644
--- a/mlir/lib/IR/TypeDetail.h
+++ b/mlir/lib/IR/TypeDetail.h
@@ -108,8 +108,8 @@ struct TupleTypeStorage final
                                      TypeRange key) {
     // Allocate a new storage instance.
     auto byteSize = TupleTypeStorage::totalSizeToAlloc<Type>(key.size());
-    auto rawMem = allocator.allocate(byteSize, alignof(TupleTypeStorage));
-    auto result = ::new (rawMem) TupleTypeStorage(key.size());
+    auto *rawMem = allocator.allocate(byteSize, alignof(TupleTypeStorage));
+    auto *result = ::new (rawMem) TupleTypeStorage(key.size());
 
     // Copy in the element types into the trailing storage.
     std::uninitialized_copy(key.begin(), key.end(),


        


More information about the Mlir-commits mailing list