def do_llvm_target(): print(" Testing module llvm.target") from llvm import target target.initialize_all() target.print_registered_targets() target.get_host_cpu_name() target.get_default_triple() tm = TargetMachine.new() tm = TargetMachine.lookup("arm") tm = TargetMachine.arm() tm = TargetMachine.thumb() tm = TargetMachine.x86() tm = TargetMachine.x86_64() tm.target_data tm.target_name tm.target_short_description tm.triple tm.cpu tm.feature_string tm.target if llvm.version >= (3, 4): tm.reg_info tm.subtarget_info tm.asm_info tm.instr_info tm.instr_analysis tm.disassembler tm.is_little_endian()
def create(self, tm=None): ''' tm --- Optional. Provide a TargetMachine. Ownership is transfered to the returned execution engine. ''' if tm is not None: engine = self._ptr.create(tm._ptr) elif (sys.platform.startswith('win32') and getattr(self, '_use_mcjit', False)): # force ELF generation on MCJIT on win32 triple = get_default_triple() tm = TargetMachine.new('%s-elf' % triple) engine = self._ptr.create(tm._ptr) else: engine = self._ptr.create() ee = ExecutionEngine(engine) ee.finalize_object() # no effect for legacy JIT return ee