forked from OSchip/llvm-project
Define the 'reference' type for the OperandType and ResultType iterators so that they can be used with llvm::enumerate.
PiperOrigin-RevId: 254422623
This commit is contained in:
parent
87a88d5353
commit
1de41ebb6c
|
@ -535,6 +535,8 @@ class OperandTypeIterator final
|
||||||
static Type unwrap(Value *value) { return value->getType(); }
|
static Type unwrap(Value *value) { return value->getType(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
using reference = Type;
|
||||||
|
|
||||||
/// Initializes the operand type iterator to the specified operand iterator.
|
/// Initializes the operand type iterator to the specified operand iterator.
|
||||||
OperandTypeIterator(OperandIterator it)
|
OperandTypeIterator(OperandIterator it)
|
||||||
: llvm::mapped_iterator<OperandIterator, Type (*)(Value *)>(it, &unwrap) {
|
: llvm::mapped_iterator<OperandIterator, Type (*)(Value *)>(it, &unwrap) {
|
||||||
|
@ -586,6 +588,8 @@ class ResultTypeIterator final
|
||||||
static Type unwrap(Value *value) { return value->getType(); }
|
static Type unwrap(Value *value) { return value->getType(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
using reference = Type;
|
||||||
|
|
||||||
/// Initializes the result type iterator to the specified result iterator.
|
/// Initializes the result type iterator to the specified result iterator.
|
||||||
ResultTypeIterator(ResultIterator it)
|
ResultTypeIterator(ResultIterator it)
|
||||||
: llvm::mapped_iterator<ResultIterator, Type (*)(Value *)>(it, &unwrap) {}
|
: llvm::mapped_iterator<ResultIterator, Type (*)(Value *)>(it, &unwrap) {}
|
||||||
|
|
Loading…
Reference in New Issue