Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34900d2748 |
7 changed files with 52 additions and 67 deletions
|
|
@ -30,11 +30,14 @@ Quickstart
|
||||||
to separate your custom build from the default system package. Please
|
to separate your custom build from the default system package. Please
|
||||||
replace ``LLVM_INSTALL_PATH`` with your own path.
|
replace ``LLVM_INSTALL_PATH`` with your own path.
|
||||||
|
|
||||||
3. Run ``REQUIRES_RTTI=1 make`` to build.
|
3. Run ``REQUIRES_RTTI=1 make install`` to build and install.
|
||||||
|
|
||||||
**Note**: With LLVM 3.2, the default build configuration has C++ RTTI
|
**Note**: With LLVM 3.2, the default build configuration has C++ RTTI
|
||||||
disabled. However, llvmpy requires RTTI.
|
disabled. However, llvmpy requires RTTI.
|
||||||
|
|
||||||
|
**Note**: Use ``make -j2 install`` to enable concurrent build.
|
||||||
|
Replace ``2`` with the actual number of processor you have.
|
||||||
|
|
||||||
4. Get llvm-py and install it::
|
4. Get llvm-py and install it::
|
||||||
|
|
||||||
$ git clone git@github.com:llvmpy/llvmpy.git
|
$ git clone git@github.com:llvmpy/llvmpy.git
|
||||||
|
|
|
||||||
17
llvm/core.py
17
llvm/core.py
|
|
@ -174,7 +174,6 @@ class OpcodeEnum(Enum):
|
||||||
OPCODE_PTRTOINT = 42
|
OPCODE_PTRTOINT = 42
|
||||||
OPCODE_INTTOPTR = 43
|
OPCODE_INTTOPTR = 43
|
||||||
OPCODE_BITCAST = 44
|
OPCODE_BITCAST = 44
|
||||||
if llvm.version <= (3, 3):
|
|
||||||
OPCODE_ICMP = 45
|
OPCODE_ICMP = 45
|
||||||
OPCODE_FCMP = 46
|
OPCODE_FCMP = 46
|
||||||
OPCODE_PHI = 47
|
OPCODE_PHI = 47
|
||||||
|
|
@ -189,22 +188,6 @@ class OpcodeEnum(Enum):
|
||||||
OPCODE_EXTRACTVALUE = 56
|
OPCODE_EXTRACTVALUE = 56
|
||||||
OPCODE_INSERTVALUE = 57
|
OPCODE_INSERTVALUE = 57
|
||||||
OPCODE_LANDINGPAD = 58
|
OPCODE_LANDINGPAD = 58
|
||||||
else:
|
|
||||||
OPCODE_ADDRSPACECAST = 45
|
|
||||||
OPCODE_ICMP = 46
|
|
||||||
OPCODE_FCMP = 47
|
|
||||||
OPCODE_PHI = 48
|
|
||||||
OPCODE_CALL = 49
|
|
||||||
OPCODE_SELECT = 50
|
|
||||||
OPCODE_USEROP1 = 51
|
|
||||||
OPCODE_USEROP2 = 52
|
|
||||||
OPCODE_VAARG = 53
|
|
||||||
OPCODE_EXTRACTELEMENT = 54
|
|
||||||
OPCODE_INSERTELEMENT = 55
|
|
||||||
OPCODE_SHUFFLEVECTOR = 56
|
|
||||||
OPCODE_EXTRACTVALUE = 57
|
|
||||||
OPCODE_INSERTVALUE = 58
|
|
||||||
OPCODE_LANDINGPAD = 59
|
|
||||||
|
|
||||||
OpcodeEnum.declare()
|
OpcodeEnum.declare()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,6 @@ class DIBuilder:
|
||||||
ref(DIType), # Ty
|
ref(DIType), # Ty
|
||||||
)
|
)
|
||||||
|
|
||||||
if LLVM_VERSION <= (3, 3):
|
|
||||||
createClassType = Method(DIType,
|
createClassType = Method(DIType,
|
||||||
ref(DIDescriptor), # Scope
|
ref(DIDescriptor), # Scope
|
||||||
stringref_arg, # Name
|
stringref_arg, # Name
|
||||||
|
|
@ -129,23 +128,6 @@ class DIBuilder:
|
||||||
ptr(MDNode), # VTableHolder = 0
|
ptr(MDNode), # VTableHolder = 0
|
||||||
ptr(MDNode), # TemplateParms = 0
|
ptr(MDNode), # TemplateParms = 0
|
||||||
).require_only(10)
|
).require_only(10)
|
||||||
else:
|
|
||||||
createClassType = Method(DIType,
|
|
||||||
ref(DIDescriptor), # Scope
|
|
||||||
stringref_arg, # Name
|
|
||||||
ref(DIFile), # File
|
|
||||||
unsigned_arg, # LineNum
|
|
||||||
uint64_arg, # SizeInBits
|
|
||||||
uint64_arg, # AlignInBits
|
|
||||||
uint64_arg, # OffsetInBits,
|
|
||||||
unsigned_arg, # Flags
|
|
||||||
ref(DIType), # DerivedFrom
|
|
||||||
ref(DIArray), # Elements
|
|
||||||
ref(DIType), # VTableHolder = DIType()
|
|
||||||
ptr(MDNode), # TemplateParms = 0
|
|
||||||
stringref_arg, # UniqueIdentifier
|
|
||||||
).require_only(10)
|
|
||||||
|
|
||||||
|
|
||||||
if LLVM_VERSION >= (3, 3):
|
if LLVM_VERSION >= (3, 3):
|
||||||
createStructType = Method(DIType,
|
createStructType = Method(DIType,
|
||||||
|
|
@ -321,7 +303,7 @@ class DIBuilder:
|
||||||
bool_arg, # isDefinition
|
bool_arg, # isDefinition
|
||||||
unsigned_arg, # Virtuality=0
|
unsigned_arg, # Virtuality=0
|
||||||
unsigned_arg, # VTableIndex=0
|
unsigned_arg, # VTableIndex=0
|
||||||
ptr(MDNode) if LLVM_VERSION <= (3, 3) else ref(DIType), # VTableHolder
|
ptr(MDNode), # *VTableHolder=0
|
||||||
unsigned_arg, # Flags=0
|
unsigned_arg, # Flags=0
|
||||||
bool_arg, # isOptimized=false
|
bool_arg, # isOptimized=false
|
||||||
ptr(Function), # *Fn=0
|
ptr(Function), # *Fn=0
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,9 @@ class ExecutionEngine:
|
||||||
isLazyCompilationDisabled = Method(cast(Bool, bool))
|
isLazyCompilationDisabled = Method(cast(Bool, bool))
|
||||||
DisableGVCompilation = Method(Void, cast(bool, Bool))
|
DisableGVCompilation = Method(Void, cast(bool, Bool))
|
||||||
isSymbolSearchingDisabled = Method(cast(Bool, bool))
|
isSymbolSearchingDisabled = Method(cast(Bool, bool))
|
||||||
|
RegisterTable = Method(Void, ptr(Function), cast(int, VoidPtr))
|
||||||
|
DeregisterTable = Method(Void, ptr(Function))
|
||||||
|
DeregisterAllTables = Method()
|
||||||
|
|
||||||
_runFunction = CustomMethod('ExecutionEngine_RunFunction',
|
_runFunction = CustomMethod('ExecutionEngine_RunFunction',
|
||||||
PyObjectPtr, ptr(Function), PyObjectPtr)
|
PyObjectPtr, ptr(Function), PyObjectPtr)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class GlobalValue:
|
||||||
|
|
||||||
LinkageTypes = Enum('''
|
LinkageTypes = Enum('''
|
||||||
ExternalLinkage, AvailableExternallyLinkage, LinkOnceAnyLinkage,
|
ExternalLinkage, AvailableExternallyLinkage, LinkOnceAnyLinkage,
|
||||||
LinkOnceODRLinkage, WeakAnyLinkage,
|
LinkOnceODRLinkage, LinkOnceODRAutoHideLinkage, WeakAnyLinkage,
|
||||||
WeakODRLinkage, AppendingLinkage, InternalLinkage, PrivateLinkage,
|
WeakODRLinkage, AppendingLinkage, InternalLinkage, PrivateLinkage,
|
||||||
LinkerPrivateLinkage, LinkerPrivateWeakLinkage, DLLImportLinkage,
|
LinkerPrivateLinkage, LinkerPrivateWeakLinkage, DLLImportLinkage,
|
||||||
DLLExportLinkage, ExternalWeakLinkage, CommonLinkage
|
DLLExportLinkage, ExternalWeakLinkage, CommonLinkage
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,13 @@ class Target:
|
||||||
hasJIT = _has()
|
hasJIT = _has()
|
||||||
hasTargetMachine = _has()
|
hasTargetMachine = _has()
|
||||||
hasMCAsmBackend = _has()
|
hasMCAsmBackend = _has()
|
||||||
|
hasMCAsmParser = _has()
|
||||||
|
hasAsmPrinter = _has()
|
||||||
|
hasMCDisassembler = _has()
|
||||||
|
hasMCInstPrinter = _has()
|
||||||
|
hasMCCodeEmitter = _has()
|
||||||
|
hasMCObjectStreamer = _has()
|
||||||
|
hasAsmStreamer = _has()
|
||||||
|
|
||||||
createTargetMachine = Method(ptr(TargetMachine),
|
createTargetMachine = Method(ptr(TargetMachine),
|
||||||
cast(str, StringRef), # triple
|
cast(str, StringRef), # triple
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,14 @@ mthds = (
|
||||||
("description:", "getShortDescription"),
|
("description:", "getShortDescription"),
|
||||||
("has JIT:", "hasJIT" ),
|
("has JIT:", "hasJIT" ),
|
||||||
("has target machine:", "hasTargetMachine" ),
|
("has target machine:", "hasTargetMachine" ),
|
||||||
("has asm backend:", "hasMCAsmBackend" )
|
("has asm backend:", "hasMCAsmBackend" ),
|
||||||
|
("has asm parser:", "hasMCAsmParser" ),
|
||||||
|
("has asm printer:", "hasAsmPrinter" ),
|
||||||
|
("has disassembler:", "hasMCDisassembler" ),
|
||||||
|
("has inst printer:", "hasMCInstPrinter" ),
|
||||||
|
("has code emitter:", "hasMCCodeEmitter" ),
|
||||||
|
("has object streamer:", "hasMCObjectStreamer"),
|
||||||
|
("has asm streamer:", "hasAsmStreamer" )
|
||||||
)
|
)
|
||||||
|
|
||||||
for target in llvm.TargetRegistry.targetsList():
|
for target in llvm.TargetRegistry.targetsList():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue