Add ways to get the value of a ConstantInt
- property z_ext_value gets the zero-extended value using LLVMConstIntGetZExtValue - property s_ext_value gets the sign-extended value using LLVMConstIntGetSExtValue - add test case for both
This commit is contained in:
parent
3b22d5accf
commit
41953602bf
3 changed files with 28 additions and 2 deletions
|
|
@ -461,6 +461,8 @@ _wLLVMConstReal(PyObject *self, PyObject *args)
|
|||
}
|
||||
|
||||
_wrap_objstr2obj(LLVMConstRealOfString, LLVMTypeRef, LLVMValueRef)
|
||||
_wrap_obj2obj(LLVMConstIntGetZExtValue, LLVMValueRef, llvmwrap_ull)
|
||||
_wrap_obj2obj(LLVMConstIntGetSExtValue, LLVMValueRef, llvmwrap_ll)
|
||||
|
||||
/* Operations on composite constants */
|
||||
|
||||
|
|
@ -1580,6 +1582,8 @@ static PyMethodDef core_methods[] = {
|
|||
_method( LLVMConstInt )
|
||||
_method( LLVMConstReal )
|
||||
_method( LLVMConstRealOfString )
|
||||
_method( LLVMConstIntGetZExtValue )
|
||||
_method( LLVMConstIntGetSExtValue )
|
||||
|
||||
/* Operations on composite constants */
|
||||
_method( LLVMConstString )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue