Binding for PassManagerBuilder
This commit is contained in:
parent
7788346152
commit
1f49bb6d7c
9 changed files with 151 additions and 10 deletions
|
|
@ -50,8 +50,9 @@ class EngineBuilder:
|
|||
_selectTarget0.realname = 'selectTarget'
|
||||
|
||||
_selectTarget1 = CustomMethod('EngineBuilder_selectTarget',
|
||||
PyObjectPtr,
|
||||
const(ref(Triple)), cast(str, StringRef),
|
||||
cast(str, StringRef), PyObjectPtr),
|
||||
cast(str, StringRef), PyObjectPtr)
|
||||
|
||||
@CustomPythonMethod
|
||||
def selectTarget(self, *args):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
from binding import *
|
||||
from namespace import llvm
|
||||
from PassManager import PassManagerBase, FunctionPassManager
|
||||
from TargetLibraryInfo import TargetLibraryInfo
|
||||
from Pass import Pass
|
||||
|
||||
@llvm.Class()
|
||||
class PassManagerBuilder:
|
||||
|
|
@ -17,3 +19,25 @@ class PassManagerBuilder:
|
|||
cast(bool, Bool),
|
||||
cast(bool, Bool)).require_only(3)
|
||||
|
||||
def _attr_int():
|
||||
return Attr(getter=cast(Unsigned, int),
|
||||
setter=cast(int, Unsigned))
|
||||
|
||||
OptLevel = _attr_int()
|
||||
SizeLevel = _attr_int()
|
||||
|
||||
def _attr_bool():
|
||||
return Attr(getter=cast(Bool, bool),
|
||||
setter=cast(bool, Bool))
|
||||
|
||||
DisableSimplifyLibCalls = _attr_bool()
|
||||
DisableUnitAtATime = _attr_bool()
|
||||
DisableUnrollLoops = _attr_bool()
|
||||
Vectorize = _attr_bool()
|
||||
LoopVectorize = _attr_bool()
|
||||
|
||||
LibraryInfo = Attr(getter=ownedptr(TargetLibraryInfo),
|
||||
setter=ownedptr(TargetLibraryInfo))
|
||||
|
||||
Inliner = Attr(getter=ownedptr(Pass),
|
||||
setter=ownedptr(Pass))
|
||||
|
|
|
|||
9
newbinding/src/Transforms/IPO.py
Normal file
9
newbinding/src/Transforms/IPO.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from binding import *
|
||||
from namespace import llvm
|
||||
from ..Pass import Pass
|
||||
|
||||
llvm.includes.add('llvm/Transforms/IPO.h')
|
||||
|
||||
createFunctionInliningPass = llvm.Function('createFunctionInliningPass',
|
||||
ptr(Pass),
|
||||
cast(int, Unsigned)).require_only(0)
|
||||
10
newbinding/src/Transforms/__init__.py
Normal file
10
newbinding/src/Transforms/__init__.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import os.path, importlib
|
||||
|
||||
def _init():
|
||||
for fname in os.listdir(os.path.dirname(__file__)):
|
||||
if ((fname.endswith('.py') or fname.endswith('.pyc')) and
|
||||
not fname.startswith('__init__')):
|
||||
modname = os.path.basename(fname).rsplit('.', 1)[0]
|
||||
importlib.import_module('.' + modname, __name__)
|
||||
|
||||
_init()
|
||||
|
|
@ -5,7 +5,8 @@ def _init():
|
|||
if ((fname.endswith('.py') or fname.endswith('.pyc')) and
|
||||
not fname.startswith('__init__')):
|
||||
modname = os.path.basename(fname).rsplit('.', 1)[0]
|
||||
topname = __name__.rsplit('.', 1)[0]
|
||||
importlib.import_module('.' + modname, topname)
|
||||
importlib.import_module('.' + modname, __name__)
|
||||
|
||||
_init()
|
||||
|
||||
import Transforms
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
from binding import *
|
||||
|
||||
llvm = Namespace('llvm')
|
||||
default = Namespace('')
|
||||
Loading…
Add table
Add a link
Reference in a new issue