[Mlir-commits] [mlir] 6ede7cf - Apply clang-tidy fixes for readability-identifier-naming in TestBackwardDataFlowAnalysis.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Tue Jan 3 10:49:52 PST 2023


Author: Mehdi Amini
Date: 2023-01-03T18:49:33Z
New Revision: 6ede7cf842e1ce83bab98e85d3711fa5c104df5b

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

LOG: Apply clang-tidy fixes for readability-identifier-naming in TestBackwardDataFlowAnalysis.cpp (NFC)

Added: 
    

Modified: 
    mlir/test/lib/Analysis/DataFlow/TestBackwardDataFlowAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/lib/Analysis/DataFlow/TestBackwardDataFlowAnalysis.cpp b/mlir/test/lib/Analysis/DataFlow/TestBackwardDataFlowAnalysis.cpp
index c326fd2cc193..a9ed3efe8650 100644
--- a/mlir/test/lib/Analysis/DataFlow/TestBackwardDataFlowAnalysis.cpp
+++ b/mlir/test/lib/Analysis/DataFlow/TestBackwardDataFlowAnalysis.cpp
@@ -31,11 +31,11 @@ struct WrittenTo : public AbstractSparseLattice {
     os << "]";
   }
   ChangeResult addWrites(const SetVector<StringAttr> &writes) {
-    int size_before = this->writes.size();
+    int sizeBefore = this->writes.size();
     this->writes.insert(writes.begin(), writes.end());
-    int size_after = this->writes.size();
-    return size_before == size_after ? ChangeResult::NoChange
-                                     : ChangeResult::Change;
+    int sizeAfter = this->writes.size();
+    return sizeBefore == sizeAfter ? ChangeResult::NoChange
+                                   : ChangeResult::Change;
   }
   ChangeResult meet(const AbstractSparseLattice &other) override {
     const auto *rhs = reinterpret_cast<const WrittenTo *>(&other);
@@ -64,9 +64,9 @@ void WrittenToAnalysis::visitOperation(Operation *op,
                                        ArrayRef<WrittenTo *> operands,
                                        ArrayRef<const WrittenTo *> results) {
   if (auto store = dyn_cast<memref::StoreOp>(op)) {
-    SetVector<StringAttr> new_writes;
-    new_writes.insert(op->getAttrOfType<StringAttr>("tag_name"));
-    propagateIfChanged(operands[0], operands[0]->addWrites(new_writes));
+    SetVector<StringAttr> newWrites;
+    newWrites.insert(op->getAttrOfType<StringAttr>("tag_name"));
+    propagateIfChanged(operands[0], operands[0]->addWrites(newWrites));
     return;
   } // By default, every result of an op depends on every operand.
     for (const WrittenTo *r : results) {
@@ -80,11 +80,11 @@ void WrittenToAnalysis::visitOperation(Operation *op,
 void WrittenToAnalysis::visitBranchOperand(OpOperand &operand) {
   // Mark branch operands as "brancharg%d", with %d the operand number.
   WrittenTo *lattice = getLatticeElement(operand.get());
-  SetVector<StringAttr> new_writes;
-  new_writes.insert(
+  SetVector<StringAttr> newWrites;
+  newWrites.insert(
       StringAttr::get(operand.getOwner()->getContext(),
                       "brancharg" + Twine(operand.getOperandNumber())));
-  propagateIfChanged(lattice, lattice->addWrites(new_writes));
+  propagateIfChanged(lattice, lattice->addWrites(newWrites));
 }
 
 } // end anonymous namespace


        


More information about the Mlir-commits mailing list