From 64d54c49f0042db8bec2c7fa252297113dc57317 Mon Sep 17 00:00:00 2001 From: "mdevan.foobar" Date: Sun, 20 Sep 2009 09:44:08 +0000 Subject: [PATCH] Tail call property for call sites (tarkasteve, issue #19) git-svn-id: http://llvm-py.googlecode.com/svn/trunk@81 8d1e9007-1d4e-0410-b67e-1979fd6579aa --- llvm/_core.c | 5 +++++ llvm/core.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/llvm/_core.c b/llvm/_core.c index 3d15ea1..423570d 100644 --- a/llvm/_core.c +++ b/llvm/_core.c @@ -568,6 +568,9 @@ _wrap_obj2obj(LLVMGetInstructionCallConv, LLVMValueRef, int) _wrap_objintenum2none(LLVMAddInstrAttribute, LLVMValueRef, LLVMAttribute) _wrap_objintenum2none(LLVMRemoveInstrAttribute, LLVMValueRef, LLVMAttribute) _wrap_objintint2none(LLVMSetInstrParamAlignment, LLVMValueRef) +_wrap_obj2obj(LLVMIsTailCall, LLVMValueRef, int) +_wrap_objint2none(LLVMSetTailCall, LLVMValueRef) + /*===-- PHI Nodes --------------------------------------------------------===*/ @@ -1371,6 +1374,8 @@ static PyMethodDef core_methods[] = { /* Call Sites (Call or Invoke) */ _method( LLVMSetInstructionCallConv ) _method( LLVMGetInstructionCallConv ) + _method( LLVMIsTailCall ) + _method( LLVMSetTailCall ) _method( LLVMAddInstrAttribute ) _method( LLVMRemoveInstrAttribute ) _method( LLVMSetInstrParamAlignment ) diff --git a/llvm/core.py b/llvm/core.py index 64ca354..e7e444a 100644 --- a/llvm/core.py +++ b/llvm/core.py @@ -1404,6 +1404,10 @@ class CallOrInvokeInstruction(Instruction): def set_parameter_alignment(self, idx, align): _core.LLVMSetInstrParamAlignment(self.ptr, idx, align) + def _get_tc(self): return _core.LLVMIsTailCall(self.ptr) + def _set_tc(self, value): _core.LLVMSetTailCall(self.ptr, value) + tail_call = property(_get_tc, _set_tc) + class PHINode(Instruction):