Rename newbinding directory to llvmpy.
This commit is contained in:
parent
0681d2f37e
commit
3189be4d58
77 changed files with 27 additions and 23 deletions
0
llvmpy/__init__.py
Normal file
0
llvmpy/__init__.py
Normal file
|
|
@ -2,8 +2,8 @@
|
|||
Wrapped the extra functions in _api.so
|
||||
'''
|
||||
|
||||
import capsule
|
||||
import _api
|
||||
from llvmpy import capsule
|
||||
from llvmpy import _api
|
||||
#
|
||||
# Re-export the native API from the _api.extra and wrap the functions
|
||||
#
|
||||
|
|
@ -135,7 +135,7 @@ class SubModule(object):
|
|||
filepath = os.path.join(rootdir, '%s.py' % name)
|
||||
with open(filepath, 'w') as pyfile:
|
||||
println = cg.wrap_println_from_file(pyfile)
|
||||
println('import _api, capsule')
|
||||
println('from llvmpy import _api, capsule')
|
||||
for ns in self.namespaces:
|
||||
println('from . import %s' % ns.localname)
|
||||
println()
|
||||
|
|
@ -358,6 +358,7 @@ PyObject* ExecutionEngine_RunFunction(llvm::ExecutionEngine* EE,
|
|||
return NULL;
|
||||
}
|
||||
std::vector<GenericValue> vec_args;
|
||||
|
||||
Py_ssize_t nargs = PyTuple_Size(Args);
|
||||
vec_args.reserve(nargs);
|
||||
for (Py_ssize_t i = 0; i < nargs; ++i) {
|
||||
|
|
@ -227,7 +227,7 @@ class ConstantExpr:
|
|||
|
||||
@CustomPythonStaticMethod
|
||||
def getGetElementPtr(*args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_values(*valuelist)
|
||||
|
|
@ -242,7 +242,7 @@ class ConstantExpr:
|
|||
|
||||
@CustomPythonStaticMethod
|
||||
def getExtractValue(*args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_unsigned(*valuelist)
|
||||
|
|
@ -254,7 +254,7 @@ class ConstantExpr:
|
|||
|
||||
@CustomPythonStaticMethod
|
||||
def getInsertValue(*args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[2]
|
||||
args[1] = extra.make_small_vector_from_unsigned(*valuelist)
|
||||
|
|
@ -81,7 +81,7 @@ class DataLayout:
|
|||
|
||||
@CustomPythonMethod
|
||||
def getIndexedOffset(self, *args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
args[1] = extra.make_small_vector_from_values(args[1])
|
||||
return self.getIndexedOffset(*args)
|
||||
|
|
@ -17,7 +17,7 @@ class FunctionType:
|
|||
|
||||
@CustomPythonStaticMethod
|
||||
def get(*args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
if len(args) == 3:
|
||||
typelist = args[1]
|
||||
sv = extra.make_small_vector_from_types(*typelist)
|
||||
|
|
@ -88,7 +88,7 @@ class ExecutionEngine:
|
|||
|
||||
@CustomPythonMethod
|
||||
def runFunction(self, fn, args):
|
||||
import capsule
|
||||
from llvmpy import capsule
|
||||
unwrapped = map(capsule.unwrap, args)
|
||||
return self._runFunction(fn, tuple(unwrapped))
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateInvoke(self, *args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[3]
|
||||
args[3] = extra.make_small_vector_from_values(*valuelist)
|
||||
|
|
@ -181,7 +181,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateGEP(self, *args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_values(*valuelist)
|
||||
|
|
@ -194,7 +194,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateInBoundsGEP(self, *args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_values(*valuelist)
|
||||
|
|
@ -241,7 +241,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateCall(self, *args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_values(*valuelist)
|
||||
|
|
@ -282,7 +282,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateExtractValue(self, args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[1]
|
||||
args[1] = extra.make_small_vector_from_unsigned(*valuelist)
|
||||
|
|
@ -295,7 +295,7 @@ class IRBuilder:
|
|||
|
||||
@CustomPythonMethod
|
||||
def CreateInsertValue(self, args):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
args = list(args)
|
||||
valuelist = args[2]
|
||||
args[1] = extra.make_small_vector_from_unsigned(*valuelist)
|
||||
|
|
@ -46,7 +46,7 @@ class NamedMDNode:
|
|||
|
||||
@CustomPythonMethod
|
||||
def __str__(self):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
os = extra.make_raw_ostream_for_printing()
|
||||
self.print_(os, None)
|
||||
return os.str()
|
||||
|
|
@ -77,7 +77,7 @@ class Module:
|
|||
|
||||
@CustomPythonMethod
|
||||
def __str__(self):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
os = extra.make_raw_ostream_for_printing()
|
||||
self.print_(os, None)
|
||||
return os.str()
|
||||
|
|
@ -125,7 +125,7 @@ class Type:
|
|||
|
||||
@CustomPythonMethod
|
||||
def __str__(self):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
os = extra.make_raw_ostream_for_printing()
|
||||
self.print_(os)
|
||||
return os.str()
|
||||
|
|
@ -56,7 +56,7 @@ class Value:
|
|||
|
||||
@CustomPythonMethod
|
||||
def __str__(self):
|
||||
import extra
|
||||
from llvmpy import extra
|
||||
os = extra.make_raw_ostream_for_printing()
|
||||
self.print_(os, None)
|
||||
return os.str()
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
from api import llvm
|
||||
import extra
|
||||
import _capsule
|
||||
from StringIO import StringIO
|
||||
llvm.capsule.set_debug(True)
|
||||
|
||||
from llvmpy.api import llvm
|
||||
from llvmpy import extra
|
||||
from llvmpy import _capsule
|
||||
import llvmpy.capsule
|
||||
llvmpy.capsule.set_debug(True)
|
||||
|
||||
|
||||
def test_basic_jit_use():
|
||||
llvm.InitializeNativeTarget()
|
||||
Loading…
Add table
Add a link
Reference in a new issue