Skip to content

Commit fc95558

Browse files
[TableGen] Use size_t for SubRegIndicesSize (NFC) (#168728)
This patch changes the type of SubRegIndicesSize to size_t. The original type deduced for "auto" is a signed type, but size_t, an unsigned type, is safe here according to the usage.
1 parent 36f9d5a commit fc95558

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/RegisterInfoEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void RegisterInfoEmitter::emitComposeSubRegIndices(raw_ostream &OS,
703703
SmallVector<unsigned, 4> RowMap;
704704
SmallVector<SmallVector<const CodeGenSubRegIndex *, 4>, 4> Rows;
705705

706-
auto SubRegIndicesSize = llvm::size(SubRegIndices);
706+
size_t SubRegIndicesSize = llvm::size(SubRegIndices);
707707
for (const auto &Idx : SubRegIndices) {
708708
unsigned Found = ~0u;
709709
for (unsigned r = 0, re = Rows.size(); r != re; ++r) {
@@ -1526,7 +1526,7 @@ void RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, raw_ostream &MainOS,
15261526

15271527
std::string ClassName = Target.getName().str() + "GenRegisterInfo";
15281528

1529-
auto SubRegIndicesSize = llvm::size(SubRegIndices);
1529+
size_t SubRegIndicesSize = llvm::size(SubRegIndices);
15301530

15311531
if (!SubRegIndices.empty()) {
15321532
emitComposeSubRegIndices(OS, ClassName);

0 commit comments

Comments
 (0)