File: issue10.py

package info (click to toggle)
llvm-py 0.5%2Bsvn85-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 996 kB
  • ctags: 1,768
  • sloc: python: 3,655; ansic: 1,893; cpp: 495; pascal: 91; makefile: 8; sh: 1
file content (21 lines) | stat: -rwxr-xr-x 392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

from llvm.core import *
import llvm._core

m = Module.new('a')
ti = Type.int()
tf = Type.function(ti, [ti, ti])

f = m.add_function(tf, "func1")

bb = f.append_basic_block('entry')

b = Builder.new(bb)

# There are no instructions in bb. Positioning of the
# builder at beginning (or end) should succeed (trivially).

b.position_at_end(bb)
b.position_at_beginning(bb)