Skip to content

Commit 3e230bb

Browse files
authored
[CodeGen] Return ArrayRef from TargetRegisterClass::getRegisters. NFCI. (#80411)
This will allow future patches to use indexing and methods like drop_front on the result.
1 parent f33a0a4 commit 3e230bb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/include/llvm/CodeGen/TargetRegisterInfo.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ class TargetRegisterClass {
8181
/// Return the number of registers in this class.
8282
unsigned getNumRegs() const { return MC->getNumRegs(); }
8383

84-
iterator_range<SmallVectorImpl<MCPhysReg>::const_iterator>
85-
getRegisters() const {
86-
return make_range(MC->begin(), MC->end());
84+
ArrayRef<MCPhysReg> getRegisters() const {
85+
return ArrayRef(begin(), getNumRegs());
8786
}
8887

8988
/// Return the specified register in the class.
@@ -203,7 +202,7 @@ class TargetRegisterClass {
203202
///
204203
/// By default, this method returns all registers in the class.
205204
ArrayRef<MCPhysReg> getRawAllocationOrder(const MachineFunction &MF) const {
206-
return OrderFunc ? OrderFunc(MF) : ArrayRef(begin(), getNumRegs());
205+
return OrderFunc ? OrderFunc(MF) : getRegisters();
207206
}
208207

209208
/// Returns the combination of all lane masks of register in this class.

0 commit comments

Comments
 (0)