diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h --- a/llvm/include/llvm/MC/MCRegisterInfo.h +++ b/llvm/include/llvm/MC/MCRegisterInfo.h @@ -324,6 +324,14 @@ return make_range({Reg, this}, mc_superreg_iterator::end()); } + /// Return an iterator range over all sub- and super-registers of \p Reg, + /// including \p Reg. + detail::concat_range, + iterator_range> + sub_and_superregs_inclusive(MCRegister Reg) const { + return concat(subregs_inclusive(Reg), superregs(Reg)); + } + // These iterators are allowed to sub-class DiffListIterator and access // internal list pointers. friend class MCSubRegIterator;