Make operation names hashable.

PiperOrigin-RevId: 223104253
This commit is contained in:
River Riddle 2018-11-27 20:32:31 -08:00 committed by jpienaar
parent 67939e8b70
commit 312d8ee96b
1 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,11 @@ inline bool operator!=(OperationName lhs, OperationName rhs) {
return lhs.getAsOpaquePointer() != rhs.getAsOpaquePointer();
}
// Make operation names hashable.
inline llvm::hash_code hash_value(OperationName arg) {
return llvm::hash_value(arg.getAsOpaquePointer());
}
/// This represents an operation in an abstracted form, suitable for use with
/// the builder APIs. This object is a large and heavy weight object meant to
/// be used as a temporary object on the stack. It is generally unwise to put