diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h index e52f0a4ff86ed..fb4d11ec1d4d1 100644 --- a/llvm/include/llvm/MC/MCRegisterInfo.h +++ b/llvm/include/llvm/MC/MCRegisterInfo.h @@ -572,9 +572,10 @@ class MCSubRegIndexIterator { bool isValid() const { return SRIter.isValid(); } /// Moves to the next position. - void operator++() { + MCSubRegIndexIterator &operator++() { ++SRIter; ++SRIndex; + return *this; } }; @@ -688,9 +689,10 @@ class MCRegUnitMaskIterator { bool isValid() const { return RUIter.isValid(); } /// Moves to the next position. - void operator++() { + MCRegUnitMaskIterator &operator++() { ++MaskListIter; ++RUIter; + return *this; } }; @@ -728,10 +730,11 @@ class MCRegUnitRootIterator { } /// Preincrement to move to the next root register. - void operator++() { + MCRegUnitRootIterator &operator++() { assert(isValid() && "Cannot move off the end of the list."); Reg0 = Reg1; Reg1 = 0; + return *this; } }; @@ -788,10 +791,11 @@ class MCRegAliasIterator { } } - void operator++() { + MCRegAliasIterator &operator++() { assert(isValid() && "Cannot move off the end of the list."); do advance(); while (!IncludeSelf && isValid() && *SI == Reg); + return *this; } };