add method to retrieve host cpu name
add stub method to enginebuilder to setMCPU and setMAttrs -- these are not implemented in llvm3.1
This commit is contained in:
parent
db24036adb
commit
1ed2049395
5 changed files with 65 additions and 3 deletions
13
llvm/ee.py
13
llvm/ee.py
|
|
@ -225,6 +225,14 @@ class EngineBuilder(object):
|
|||
_core.LLVMEngineBuilderSetOptLevel(self.ptr, level)
|
||||
return self
|
||||
|
||||
def mattrs(self, string):
|
||||
'''set machine attributes as a comma/space separated string
|
||||
|
||||
e.g: +sse,-3dnow
|
||||
'''
|
||||
_core.LLVMEngineBuilderSetMAttrs(self.ptr, string.replace(',', ' '))
|
||||
return self
|
||||
|
||||
def create(self):
|
||||
ret = _core.LLVMEngineBuilderCreate(self.ptr)
|
||||
if isinstance(ret, str):
|
||||
|
|
@ -310,6 +318,11 @@ def print_registered_targets():
|
|||
'''
|
||||
_core.LLVMPrintRegisteredTargetsForVersion()
|
||||
|
||||
def get_host_cpu_name():
|
||||
'''return the string name of the host CPU
|
||||
'''
|
||||
return _core.LLVMGetHostCPUName()
|
||||
|
||||
class TargetMachine(object):
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue