NFC: Add 'const' dereference method to OperandTypeIterator.

The deference provided by mapped_iterator is non-const.

PiperOrigin-RevId: 271051375
This commit is contained in:
River Riddle 2019-09-24 21:54:25 -07:00 committed by A. Unique TensorFlower
parent c5284fe85e
commit 03db422359

View file

@ -638,6 +638,9 @@ class OperandTypeIterator final
public:
using reference = Type;
/// Provide a const deference method.
Type operator*() const { return unwrap(*I); }
/// Initializes the operand type iterator to the specified operand iterator.
OperandTypeIterator(OperandIterator it)
: llvm::mapped_iterator<OperandIterator, Type (*)(Value *)>(it, &unwrap) {