[Mlir-commits] [mlir] ac86024 - [mlir][NFC] Cleanup the TestClone pass

River Riddle llvmlistbot at llvm.org
Fri Apr 15 12:57:31 PDT 2022


Author: River Riddle
Date: 2022-04-15T12:57:07-07:00
New Revision: ac860240adc79fefcf8e1c7c7ed7df89827b332a

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

LOG: [mlir][NFC] Cleanup the TestClone pass

Fix variable naming convention and cleanup a clang-tidy warning.

Added: 
    

Modified: 
    mlir/test/lib/IR/TestClone.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/lib/IR/TestClone.cpp b/mlir/test/lib/IR/TestClone.cpp
index 61c2a68d591df..5d80e9356f14f 100644
--- a/mlir/test/lib/IR/TestClone.cpp
+++ b/mlir/test/lib/IR/TestClone.cpp
@@ -20,6 +20,7 @@ namespace {
 struct ClonePass
     : public PassWrapper<ClonePass, InterfacePass<FunctionOpInterface>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ClonePass)
+
   StringRef getArgument() const final { return "test-clone"; }
   StringRef getDescription() const final { return "Test clone of op"; }
   void runOnOperation() override {
@@ -34,7 +35,7 @@ struct ClonePass
       return;
 
     Block &regionEntry = region.front();
-    auto terminator = regionEntry.getTerminator();
+    Operation *terminator = regionEntry.getTerminator();
 
     // Only handle functions whose returns match the inputs.
     if (terminator->getNumOperands() != regionEntry.getNumArguments())
@@ -48,13 +49,13 @@ struct ClonePass
       map.map(std::get<1>(tup), std::get<0>(tup));
     }
 
-    OpBuilder B(op->getContext());
-    B.setInsertionPointToEnd(&regionEntry);
+    OpBuilder builder(op->getContext());
+    builder.setInsertionPointToEnd(&regionEntry);
     SmallVector<Operation *> toClone;
     for (Operation &inst : regionEntry)
       toClone.push_back(&inst);
     for (Operation *inst : toClone)
-      B.clone(*inst, map);
+      builder.clone(*inst, map);
     terminator->erase();
   }
 };


        


More information about the Mlir-commits mailing list