Implement property ConstantExpr.opcode

Use LLVM C-API function `LLVMGetConstOpcode`
This commit is contained in:
Wladimir J. van der Laan 2012-09-01 17:31:08 +02:00
commit c033ba02a4
2 changed files with 5 additions and 1 deletions

View file

@ -485,6 +485,7 @@ _wrap_list2obj(LLVMConstVector, LLVMValueRef, LLVMValueRef)
/* Constant expressions */
_wrap_obj2obj(LLVMGetConstOpcode, LLVMValueRef, int)
_wrap_obj2obj(LLVMSizeOf, LLVMTypeRef, LLVMValueRef)
_wrap_obj2obj(LLVMConstNeg, LLVMValueRef, LLVMValueRef)
_wrap_obj2obj(LLVMConstNot, LLVMValueRef, LLVMValueRef)
@ -1579,6 +1580,7 @@ static PyMethodDef core_methods[] = {
_method( LLVMConstVector )
/* Constant expressions */
_method( LLVMGetConstOpcode )
_method( LLVMSizeOf )
_method( LLVMConstNeg )
_method( LLVMConstNot )

View file

@ -1172,7 +1172,9 @@ class Constant(User):
class ConstantExpr(Constant):
pass
@property
def opcode(self):
return _core.LLVMGetConstOpcode(self.ptr)
class ConstantAggregateZero(Constant):