[llvm] [llvm] Use llvm::size (NFC) (PR #168675)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 07:50:10 PST 2025


================
@@ -1527,8 +1526,7 @@ void RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, raw_ostream &MainOS,
 
   std::string ClassName = Target.getName().str() + "GenRegisterInfo";
 
-  auto SubRegIndicesSize =
-      std::distance(SubRegIndices.begin(), SubRegIndices.end());
+  auto SubRegIndicesSize = llvm::size(SubRegIndices);
----------------
kazutakahirata wrote:

Sorry, I read this after I merged the PR.  Technically, the type of `llvm::size` is a signed type, but I'm happy to change it to an unsigned one.

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


More information about the llvm-commits mailing list