[llvm] Reland "MTM: fix issues after cursory reading" (PR #101191)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 08:54:45 PDT 2024


================
@@ -969,10 +963,8 @@ static bool pushDepHeight(const DataDep &Dep, const MachineInstr &UseMI,
                                                   Dep.UseOp);
 
   // Update Heights[DefMI] to be the maximum height seen.
-  MIHeightMap::iterator I;
-  bool New;
-  std::tie(I, New) = Heights.insert(std::make_pair(Dep.DefMI, UseHeight));
-  if (New)
+  const auto &[I, Inserted] = Heights.insert({Dep.DefMI, UseHeight});
+  if (Inserted)
----------------
s-barannikov wrote:

The coding standard says nothing about structured bindings. But it says something about `auto` -- that using it is discouraged, unless it clearly improves readability.


https://github.com/llvm/llvm-project/pull/101191


More information about the llvm-commits mailing list