[llvm] [TableGen] Use llvm::enumerate in one place (NFC) (PR #136399)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 18 20:43:28 PDT 2025


================
@@ -200,26 +200,24 @@ CodeGenInstAlias::CodeGenInstAlias(const Record *R, const CodeGenTarget &T)
 
   // Decode and validate the arguments of the result.
   unsigned AliasOpNo = 0;
-  for (unsigned i = 0, e = ResultInst->Operands.size(); i != e; ++i) {
-
+  for (auto [OpIdx, OpInfo] : enumerate(ResultInst->Operands)) {
----------------
kazutakahirata wrote:

Could we use `const auto &[OpIdx, OpInfo]` here to avoid making a copy?

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


More information about the llvm-commits mailing list