Add support to emit assembly.
This commit is contained in:
parent
168510222f
commit
da85049eb9
6 changed files with 102 additions and 0 deletions
9
newbinding/src/Support/FormattedStream.py
Normal file
9
newbinding/src/Support/FormattedStream.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from binding import *
|
||||
from ..namespace import llvm
|
||||
from raw_ostream import raw_ostream
|
||||
|
||||
@llvm.Class(raw_ostream)
|
||||
class formatted_raw_ostream:
|
||||
_include_ = 'llvm/Support/FormattedStream.h'
|
||||
new = Constructor(ref(raw_ostream), cast(bool, Bool))
|
||||
|
||||
|
|
@ -6,3 +6,12 @@ llvm.includes.add('llvm/Support/TargetSelect.h')
|
|||
InitializeNativeTarget = llvm.Function('InitializeNativeTarget')
|
||||
#llvm.Function('InitializeAllTargets')
|
||||
|
||||
InitializeNativeTargetAsmPrinter = llvm.Function(
|
||||
'InitializeNativeTargetAsmPrinter', cast(Bool, bool))
|
||||
|
||||
InitializeNativeTargetAsmParser = llvm.Function(
|
||||
'InitializeNativeTargetAsmParser', cast(Bool, bool))
|
||||
|
||||
InitializeNativeTargetDisassembler = llvm.Function(
|
||||
'InitializeNativeTargetDisassembler', cast(Bool, bool))
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from ..ADT.StringRef import StringRef
|
|||
class raw_ostream:
|
||||
_include_ = "llvm/Support/raw_ostream.h"
|
||||
delete = Destructor()
|
||||
flush = Method()
|
||||
|
||||
@llvm.Class(raw_ostream)
|
||||
class raw_svector_ostream:
|
||||
|
|
|
|||
|
|
@ -7,12 +7,20 @@ from ..Support.Target import Target
|
|||
from ..DataLayout import DataLayout
|
||||
from ..TargetTransformInfo import (ScalarTargetTransformInfo,
|
||||
VectorTargetTransformInfo)
|
||||
from ..PassManager import PassManagerBase
|
||||
from ..Support.FormattedStream import formatted_raw_ostream
|
||||
|
||||
TargetMachine = llvm.Class()
|
||||
|
||||
@TargetMachine
|
||||
class TargetMachine:
|
||||
_include_ = 'llvm/Target/TargetMachine.h'
|
||||
|
||||
CodeGenFileType = Enum('''
|
||||
CGFT_AssemblyFile
|
||||
CGFT_ObjectFile
|
||||
CGFT_Null''')
|
||||
|
||||
delete = Destructor()
|
||||
|
||||
getTarget = Method(const(ref(Target)))
|
||||
|
|
@ -34,3 +42,12 @@ class TargetMachine:
|
|||
ownedptr(ScalarTargetTransformInfo)))
|
||||
getVectorTargetTransformInfo = Method(const(
|
||||
ownedptr(VectorTargetTransformInfo)))
|
||||
|
||||
addPassesToEmitFile = Method(cast(bool, Bool),
|
||||
ref(PassManagerBase),
|
||||
ref(formatted_raw_ostream),
|
||||
CodeGenFileType,
|
||||
cast(bool, Bool)
|
||||
).require_only(3)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue