Can now modify called_function of CallOrInvokeInstruction

This commit is contained in:
Siu Kwan Lam 2012-11-01 11:41:28 -05:00
commit b9d05bb6fe
4 changed files with 19 additions and 3 deletions

View file

@ -1670,12 +1670,16 @@ class CallOrInvokeInstruction(Instruction):
def set_parameter_alignment(self, idx, align):
_core.LLVMSetInstrParamAlignment(self.ptr, idx, align)
@property
def called_function(self):
def _get_called_function(self):
function = _core.LLVMInstGetCalledFunction(self.ptr)
if function: # Return value can be None on indirect call/invoke
return _make_value(function)
def _set_called_function(self, function):
_core.LLVMInstSetCalledFunction(self.ptr, function.ptr)
called_function = property(_get_called_function, _set_called_function)
# tail call is valid only for 'call', not 'invoke'
# disabled for now
#def _get_tc(self): return _core.LLVMIsTailCall(self.ptr)