Fix the value_type of defusechain_iterator to match its operator*()
defusechain_iterator has an operator*() and operator->() that return references to a MachineOperand, but its "reference" and "pointer" typedefs are set as if the iterator returns a MachineInstr reference. This causes compilation errors when defusechain_iterator is used in generic code that uses the "reference" and "pointer" typedefs. This patch fixes this by updating the typedefs to use MachineOperand instead of MachineInstr. Reviewed By: mkitzan Differential Revision: https://reviews.llvm.org/D97522
This commit is contained in:
parent
8adfb38224
commit
6fb6bdff37
|
|
@ -968,10 +968,10 @@ public:
|
||||||
/// returns defs. If neither are true then you are silly and it always
|
/// returns defs. If neither are true then you are silly and it always
|
||||||
/// returns end(). If SkipDebug is true it skips uses marked Debug
|
/// returns end(). If SkipDebug is true it skips uses marked Debug
|
||||||
/// when incrementing.
|
/// when incrementing.
|
||||||
template<bool ReturnUses, bool ReturnDefs, bool SkipDebug,
|
template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByOperand,
|
||||||
bool ByOperand, bool ByInstr, bool ByBundle>
|
bool ByInstr, bool ByBundle>
|
||||||
class defusechain_iterator
|
class defusechain_iterator : public std::iterator<std::forward_iterator_tag,
|
||||||
: public std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t> {
|
MachineOperand, ptrdiff_t> {
|
||||||
friend class MachineRegisterInfo;
|
friend class MachineRegisterInfo;
|
||||||
|
|
||||||
MachineOperand *Op = nullptr;
|
MachineOperand *Op = nullptr;
|
||||||
|
|
@ -1008,10 +1008,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using reference = std::iterator<std::forward_iterator_tag,
|
using reference = std::iterator<std::forward_iterator_tag, MachineOperand,
|
||||||
MachineInstr, ptrdiff_t>::reference;
|
ptrdiff_t>::reference;
|
||||||
using pointer = std::iterator<std::forward_iterator_tag,
|
using pointer = std::iterator<std::forward_iterator_tag, MachineOperand,
|
||||||
MachineInstr, ptrdiff_t>::pointer;
|
ptrdiff_t>::pointer;
|
||||||
|
|
||||||
defusechain_iterator() = default;
|
defusechain_iterator() = default;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue