Merge pull request #18 from laanwj/2012_09_constantint_value

Thanks!
This commit is contained in:
Siu Kwan Lam 2012-09-10 16:41:19 -07:00
commit 47baa49160
5 changed files with 34 additions and 2 deletions

View file

@ -1193,7 +1193,17 @@ class ConstantDataVector(Constant):
pass
class ConstantInt(Constant):
pass
@property
def z_ext_value(self):
'''Obtain the zero extended value for an integer constant value.'''
# Warning: assertion failure when value does not fit in 64 bits
return _core.LLVMConstIntGetZExtValue(self.ptr)
@property
def s_ext_value(self):
'''Obtain the sign extended value for an integer constant value.'''
# Warning: assertion failure when value does not fit in 64 bits
return _core.LLVMConstIntGetSExtValue(self.ptr)
class ConstantFP(Constant):