Fix hashing of llvm type

This commit is contained in:
Siu Kwan Lam 2013-05-16 11:34:27 -05:00
commit 331f71f26f
2 changed files with 29 additions and 1 deletions

View file

@ -800,6 +800,9 @@ class Type(llvm.Wrapper):
def __str__(self):
return str(self._ptr)
def __hash__(self):
return hash(self._ptr)
def __eq__(self, rhs):
return self._ptr is rhs._ptr
@ -901,7 +904,6 @@ class StructType(Type):
def is_layout_identical(self, other):
return self._ptr.isLayoutIdentical(other._ptr)
class ArrayType(Type):
"""Represents an array type."""
_type_ = api.llvm.ArrayType