[clang][dataflow] Rename iterators from IT to It
authorDmitri Gribenko <gribozavr@gmail.com>
Mon, 25 Jul 2022 18:23:23 +0000 (20:23 +0200)
committerDmitri Gribenko <gribozavr@gmail.com>
Mon, 25 Jul 2022 18:28:47 +0000 (20:28 +0200)
The latter way to abbreviate is a lot more common in the LLVM codebase.

Reviewed By: sgatev, xazax.hun

Differential Revision: https://reviews.llvm.org/D130423

clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
clang/lib/Analysis/FlowSensitive/Transfer.cpp
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp

index 5105999..8f2296d 100644 (file)
@@ -199,18 +199,18 @@ void DataflowAnalysisContext::addTransitiveFlowConditionConstraints(
   if (!Res.second)
     return;
 
-  auto ConstraintsIT = FlowConditionConstraints.find(&Token);
-  if (ConstraintsIT == FlowConditionConstraints.end()) {
+  auto ConstraintsIt = FlowConditionConstraints.find(&Token);
+  if (ConstraintsIt == FlowConditionConstraints.end()) {
     Constraints.insert(&Token);
   } else {
     // Bind flow condition token via `iff` to its set of constraints:
     // FC <=> (C1 ^ C2 ^ ...), where Ci are constraints
-    Constraints.insert(&getOrCreateIff(Token, *ConstraintsIT->second));
+    Constraints.insert(&getOrCreateIff(Token, *ConstraintsIt->second));
   }
 
-  auto DepsIT = FlowConditionDeps.find(&Token);
-  if (DepsIT != FlowConditionDeps.end()) {
-    for (AtomicBoolValue *DepToken : DepsIT->second) {
+  auto DepsIt = FlowConditionDeps.find(&Token);
+  if (DepsIt != FlowConditionDeps.end()) {
+    for (AtomicBoolValue *DepToken : DepsIt->second) {
       addTransitiveFlowConditionConstraints(*DepToken, Constraints,
                                             VisitedTokens);
     }
@@ -220,10 +220,10 @@ void DataflowAnalysisContext::addTransitiveFlowConditionConstraints(
 BoolValue &DataflowAnalysisContext::substituteBoolValue(
     BoolValue &Val,
     llvm::DenseMap<BoolValue *, BoolValue *> &SubstitutionsCache) {
-  auto IT = SubstitutionsCache.find(&Val);
-  if (IT != SubstitutionsCache.end()) {
+  auto It = SubstitutionsCache.find(&Val);
+  if (It != SubstitutionsCache.end()) {
     // Return memoized result of substituting this boolean value.
-    return *IT->second;
+    return *It->second;
   }
 
   // Handle substitution on the boolean value (and its subvalues), saving the
@@ -280,19 +280,19 @@ BoolValue &DataflowAnalysisContext::buildAndSubstituteFlowCondition(
 BoolValue &DataflowAnalysisContext::buildAndSubstituteFlowConditionWithCache(
     AtomicBoolValue &Token,
     llvm::DenseMap<BoolValue *, BoolValue *> &SubstitutionsCache) {
-  auto ConstraintsIT = FlowConditionConstraints.find(&Token);
-  if (ConstraintsIT == FlowConditionConstraints.end()) {
+  auto ConstraintsIt = FlowConditionConstraints.find(&Token);
+  if (ConstraintsIt == FlowConditionConstraints.end()) {
     return getBoolLiteralValue(true);
   }
-  auto DepsIT = FlowConditionDeps.find(&Token);
-  if (DepsIT != FlowConditionDeps.end()) {
-    for (AtomicBoolValue *DepToken : DepsIT->second) {
+  auto DepsIt = FlowConditionDeps.find(&Token);
+  if (DepsIt != FlowConditionDeps.end()) {
+    for (AtomicBoolValue *DepToken : DepsIt->second) {
       auto &NewDep = buildAndSubstituteFlowConditionWithCache(
           *DepToken, SubstitutionsCache);
       SubstitutionsCache[DepToken] = &NewDep;
     }
   }
-  return substituteBoolValue(*ConstraintsIT->second, SubstitutionsCache);
+  return substituteBoolValue(*ConstraintsIt->second, SubstitutionsCache);
 }
 
 void DataflowAnalysisContext::dumpFlowCondition(AtomicBoolValue &Token) {
index 2b6cd0c..d1af293 100644 (file)
@@ -352,16 +352,16 @@ void Environment::setValue(const StorageLocation &Loc, Value &Val) {
     }
   }
 
-  auto IT = MemberLocToStruct.find(&Loc);
-  if (IT != MemberLocToStruct.end()) {
+  auto It = MemberLocToStruct.find(&Loc);
+  if (It != MemberLocToStruct.end()) {
     // `Loc` is the location of a struct member so we need to also update the
     // value of the member in the corresponding `StructValue`.
 
-    assert(IT->second.first != nullptr);
-    StructValue &StructVal = *IT->second.first;
+    assert(It->second.first != nullptr);
+    StructValue &StructVal = *It->second.first;
 
-    assert(IT->second.second != nullptr);
-    const ValueDecl &Member = *IT->second.second;
+    assert(It->second.second != nullptr);
+    const ValueDecl &Member = *It->second.second;
 
     StructVal.setChild(Member, Val);
   }
index 500e1a7..2e77920 100644 (file)
@@ -564,11 +564,11 @@ public:
     Env.setValue(Loc, *Val);
 
     if (Type->isStructureOrClassType()) {
-      for (auto IT : llvm::zip(Type->getAsRecordDecl()->fields(), S->inits())) {
-        const FieldDecl *Field = std::get<0>(IT);
+      for (auto It : llvm::zip(Type->getAsRecordDecl()->fields(), S->inits())) {
+        const FieldDecl *Field = std::get<0>(It);
         assert(Field != nullptr);
 
-        const Expr *Init = std::get<1>(IT);
+        const Expr *Init = std::get<1>(It);
         assert(Init != nullptr);
 
         if (Value *InitVal = Env.getValue(*Init, SkipPast::None))
index 6ce9dd5..6ed37d2 100644 (file)
@@ -47,9 +47,9 @@ public:
       : CFCtx(CFCtx), BlockToState(BlockToState) {}
 
   const Environment *getEnvironment(const Stmt &S) const override {
-    auto BlockIT = CFCtx.getStmtToBlock().find(&ignoreCFGOmittedNodes(S));
-    assert(BlockIT != CFCtx.getStmtToBlock().end());
-    const auto &State = BlockToState[BlockIT->getSecond()->getBlockID()];
+    auto BlockIt = CFCtx.getStmtToBlock().find(&ignoreCFGOmittedNodes(S));
+    assert(BlockIt != CFCtx.getStmtToBlock().end());
+    const auto &State = BlockToState[BlockIt->getSecond()->getBlockID()];
     assert(State);
     return &State.value().Env;
   }