Added GenericValue. EE.run() uses GVs now. Converted line endings in wrap.{c,h}.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@19 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2008-06-22 15:44:49 +00:00
commit 01eb4a7133
5 changed files with 1051 additions and 942 deletions

View file

@ -11,20 +11,20 @@ import llvm
# failures.
#===----------------------------------------------------------------------===
def _check_gen(obj, type):
def check_gen(obj, type):
if not isinstance(obj, type):
type_str = type.__name__
msg = "argument not an instance of llvm.core.%s" % type_str
raise TypeError, msg
def check_is_type(obj): _check_gen(obj, core.Type)
def check_is_value(obj): _check_gen(obj, core.Value)
def check_is_pointer(obj): _check_gen(obj, core.Pointer)
def check_is_constant(obj): _check_gen(obj, core.Constant)
def check_is_function(obj): _check_gen(obj, core.Function)
def check_is_basic_block(obj): _check_gen(obj, core.BasicBlock)
def check_is_module(obj): _check_gen(obj, core.Module)
def check_is_module_provider(obj): _check_gen(obj, core.ModuleProvider)
def check_is_type(obj): check_gen(obj, core.Type)
def check_is_value(obj): check_gen(obj, core.Value)
def check_is_pointer(obj): check_gen(obj, core.Pointer)
def check_is_constant(obj): check_gen(obj, core.Constant)
def check_is_function(obj): check_gen(obj, core.Function)
def check_is_basic_block(obj): check_gen(obj, core.BasicBlock)
def check_is_module(obj): check_gen(obj, core.Module)
def check_is_module_provider(obj): check_gen(obj, core.ModuleProvider)
def check_is_unowned(ownable):
if ownable.owner:
@ -37,13 +37,13 @@ def check_is_unowned(ownable):
# the way.
#===----------------------------------------------------------------------===
def _unpack_gen(objlist, check_fn):
def unpack_gen(objlist, check_fn):
for obj in objlist: check_fn(obj)
return [ obj.ptr for obj in objlist ]
def unpack_types(objlist): return _unpack_gen(objlist, check_is_type)
def unpack_values(objlist): return _unpack_gen(objlist, check_is_value)
def unpack_constants(objlist): return _unpack_gen(objlist, check_is_constant)
def unpack_types(objlist): return unpack_gen(objlist, check_is_type)
def unpack_values(objlist): return unpack_gen(objlist, check_is_value)
def unpack_constants(objlist): return unpack_gen(objlist, check_is_constant)
#===----------------------------------------------------------------------===