14 #ifndef MLIR_IR_BLOCKANDVALUEMAPPING_H 15 #define MLIR_IR_BLOCKANDVALUEMAPPING_H 48 return lookupOrValue(from, (
Block *)
nullptr);
55 return lookupOrValue(from, from);
61 template <
typename T> T
lookup(T from)
const {
63 assert(result &&
"expected 'from' to be contained within the map");
68 void clear() { valueMap.clear(); }
74 auto it = valueMap.find(from);
75 return it != valueMap.end() ?
reinterpret_cast<Block *
>(it->second) : value;
88 #endif // MLIR_IR_BLOCKANDVALUEMAPPING_H Definition: InferTypeOpInterface.cpp:20
Block represents an ordered list of Operations.
Definition: Block.h:21
void map(Value from, Value to)
Definition: BlockAndValueMapping.h:31
Value lookupOrDefault(Value from) const
Definition: BlockAndValueMapping.h:57
T lookup(T from) const
Definition: BlockAndValueMapping.h:61
void erase(Value from)
Definition: BlockAndValueMapping.h:37
void * getAsOpaquePointer() const
Methods for supporting PointerLikeTypeTraits.
Definition: Value.h:184
void map(Block *from, Block *to)
Definition: BlockAndValueMapping.h:30
static Value getFromOpaquePointer(const void *pointer)
Definition: Value.h:185
void clear()
Clears all mappings held by the mapper.
Definition: BlockAndValueMapping.h:68
Block * lookupOrNull(Block *from) const
Definition: BlockAndValueMapping.h:47
void erase(Block *from)
Erases a mapping for 'from'.
Definition: BlockAndValueMapping.h:36
Definition: BlockAndValueMapping.h:26
bool contains(Block *from) const
Checks to see if a mapping for 'from' exists.
Definition: BlockAndValueMapping.h:40
Value lookupOrNull(Value from) const
Definition: BlockAndValueMapping.h:50
Block * lookupOrDefault(Block *from) const
Definition: BlockAndValueMapping.h:54
bool contains(Value from) const
Definition: BlockAndValueMapping.h:41