Use extract_value instead of getresult (Bryan Silverthorn) (Issue #34)
git-svn-id: http://llvm-py.googlecode.com/svn/trunk@103 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
parent
bb2d613e39
commit
ae61530aff
2 changed files with 7 additions and 4 deletions
|
|
@ -1890,11 +1890,14 @@ class Builder(object):
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
|
||||||
def getresult(self, retval, idx, name=""):
|
def extract_value(self, retval, idx, name=""):
|
||||||
check_is_value(retval)
|
check_is_value(retval)
|
||||||
return _make_value(
|
return _make_value(
|
||||||
_core.LLVMBuildGetResult(self.ptr, retval.ptr, idx, name))
|
_core.LLVMBuildGetResult(self.ptr, retval.ptr, idx, name))
|
||||||
|
|
||||||
|
# obsolete synonym for extract_value
|
||||||
|
getresult = extract_value
|
||||||
|
|
||||||
def phi(self, ty, name=""):
|
def phi(self, ty, name=""):
|
||||||
check_is_type(ty)
|
check_is_type(ty)
|
||||||
return _make_value(_core.LLVMBuildPhi(self.ptr, ty.ptr, name))
|
return _make_value(_core.LLVMBuildPhi(self.ptr, ty.ptr, name))
|
||||||
|
|
|
||||||
|
|
@ -388,8 +388,8 @@ def _do_builder_mrv():
|
||||||
blk = f.append_basic_block('b')
|
blk = f.append_basic_block('b')
|
||||||
b = Builder.new(blk)
|
b = Builder.new(blk)
|
||||||
v = b.call(f, [Constant.int(ti, 1)])
|
v = b.call(f, [Constant.int(ti, 1)])
|
||||||
v1 = b.getresult(v, 0)
|
v1 = b.extract_value(v, 0)
|
||||||
v2 = b.getresult(v, 1)
|
v2 = b.extract_value(v, 1)
|
||||||
b.ret_many([v1, v2])
|
b.ret_many([v1, v2])
|
||||||
#print f
|
#print f
|
||||||
|
|
||||||
|
|
@ -463,7 +463,7 @@ def do_builder():
|
||||||
b.fcmp(RPRED_ULT, fv, fv)
|
b.fcmp(RPRED_ULT, fv, fv)
|
||||||
vi = Constant.vector([Constant.int(ti,42)]*10)
|
vi = Constant.vector([Constant.int(ti,42)]*10)
|
||||||
vf = Constant.vector([Constant.real(Type.float(), 3.14)]*10)
|
vf = Constant.vector([Constant.real(Type.float(), 3.14)]*10)
|
||||||
# TODO b.getresult(v, 0)
|
# TODO b.extract_value(v, 0)
|
||||||
b.call(f, [v])
|
b.call(f, [v])
|
||||||
b.select(Constant.int(Type.int(1), 1), blk, blk)
|
b.select(Constant.int(Type.int(1), 1), blk, blk)
|
||||||
b.vaarg(v, Type.int())
|
b.vaarg(v, Type.int())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue