Exemple #1
0
 def new(module, force_interpreter=False):
     core.check_is_module(module)
     _util.check_is_unowned(module)
     ret = _core.LLVMCreateExecutionEngine(module.ptr, int(force_interpreter))
     if isinstance(ret, str):
         raise llvm.LLVMException(ret)
     return ExecutionEngine(ret, module)
Exemple #2
0
 def remove_module(self, module):
     core.check_is_module(module)
     if module.owner != self:
         raise llvm.LLVMException("module is not owned by self")
     ret = _core.LLVMRemoveModule2(self.ptr, module.ptr)
     if isinstance(ret, str):
         raise llvm.LLVMException(ret)
     return core.Module(ret)
Exemple #3
0
 def remove_module(self, module):
     core.check_is_module(module)
     if module.owner != self:
         raise llvm.LLVMException, "module is not owned by self"
     ret = _core.LLVMRemoveModule2(self.ptr, module.ptr)
     if isinstance(ret, str):
         raise llvm.LLVMException, ret
     return core.Module(ret)
Exemple #4
0
 def new(module, force_interpreter=False):
     core.check_is_module(module)
     _util.check_is_unowned(module)
     ret = _core.LLVMCreateExecutionEngine(module.ptr,
                                           int(force_interpreter))
     if isinstance(ret, str):
         raise llvm.LLVMException, ret
     return ExecutionEngine(ret, module)
Exemple #5
0
 def new(module):
     core.check_is_module(module)
     ptr = _core.LLVMCreateFunctionPassManagerForModule(module.ptr)
     return FunctionPassManager(ptr)
Exemple #6
0
 def run(self, module):
     core.check_is_module(module)
     return _core.LLVMRunPassManager(self.ptr, module.ptr)
Exemple #7
0
 def add_module(self, module):
     core.check_is_module(module)
     _core.LLVMAddModule(self.ptr, module.ptr)
     module._own(self)
Exemple #8
0
 def new(module):
     core.check_is_module(module)
     ptr = _core.LLVMCreateFunctionPassManagerForModule(module.ptr)
     return FunctionPassManager(ptr)
Exemple #9
0
 def run(self, module):
     core.check_is_module(module)
     return _core.LLVMRunPassManager(self.ptr, module.ptr)
Exemple #10
0
 def new(module):
     core.check_is_module(module)
     _util.check_is_unowned(module)
     obj = _core.LLVMCreateEngineBuilder(module.ptr)
     return EngineBuilder(obj, module)
Exemple #11
0
 def add_module(self, module):
     core.check_is_module(module)
     _core.LLVMAddModule(self.ptr, module.ptr)
     module._own(self)
Exemple #12
0
 def new(module):
     core.check_is_module(module)
     _util.check_is_unowned(module)
     obj = _core.LLVMCreateEngineBuilder(module.ptr)
     return EngineBuilder(obj, module)