Build cleanly with LLVM 2.3 or 2.3svn.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@15 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2008-06-18 16:31:35 +00:00
commit 9cc8fdc0cd
16 changed files with 96 additions and 58 deletions

View file

@ -23,8 +23,7 @@ func.args[1].name = "arg2"
entry = func.append_basic_block("entry")
# create an llvm::IRBuilder
builder = Builder.new()
builder.position_at_end(entry)
builder = Builder.new(entry)
# add two args into tmp1
tmp1 = builder.add(func.args[0], func.args[1], "tmp1")

View file

@ -120,9 +120,10 @@ def do_constant():
k.srem(k).and_(k).or_(k).icmp(IPRED_ULT, k)
f.fdiv(f).frem(f).fcmp(RPRED_ULT, f)
vi = Constant.vector([Constant.int(ti,42)]*10)
vi.vicmp(IPRED_ULT, vi)
vf = Constant.vector([Constant.real(Type.float(), 3.14)]*10)
vf.vfcmp(RPRED_ULT, vf)
# after LLVM 2.3!
#vi.vicmp(IPRED_ULT, vi)
#vf.vfcmp(RPRED_ULT, vf)
k.shl(k).lshr(k).ashr(k)
# TODO gep
k.trunc(Type.int(1))
@ -332,9 +333,10 @@ def do_builder():
b.icmp(IPRED_ULT, v, v)
b.fcmp(RPRED_ULT, fv, fv)
vi = Constant.vector([Constant.int(ti,42)]*10)
b.vicmp(IPRED_ULT, vi, vi)
vf = Constant.vector([Constant.real(Type.float(), 3.14)]*10)
b.vfcmp(RPRED_ULT, vf, vf)
# after LLVM 2.3!
# b.vicmp(IPRED_ULT, vi, vi)
# b.vfcmp(RPRED_ULT, vf, vf)
# TODO b.getresult(v, 0)
b.call(f, [v])
b.select(Constant.int(Type.int(1), 1), blk, blk)