Add things to make MCJIT working

This commit is contained in:
Siu Kwan Lam 2013-07-31 15:44:01 -05:00
commit 6d3253e4ea
5 changed files with 7 additions and 2 deletions

View file

@ -53,6 +53,7 @@ LLVMInterpreter
LLVMipa LLVMipa
LLVMipo LLVMipo
LLVMJIT LLVMJIT
LLVMMCJIT
LLVMLinker LLVMLinker
LLVMMC LLVMMC
LLVMMCParser LLVMMCParser
@ -71,6 +72,7 @@ LLVMX86Desc
LLVMX86Disassembler LLVMX86Disassembler
LLVMX86Info LLVMX86Info
LLVMX86Utils LLVMX86Utils
LLVMDebugInfo
Advapi32 Advapi32
Shell32 Shell32
""".split(): """.split():

View file

@ -232,7 +232,7 @@ def initialize_target(target, noraise=False):
It is safe to initialize the same target multiple times. It is safe to initialize the same target multiple times.
""" """
prefix = 'LLVMInitialize' prefix = 'LLVMInitialize'
postfixes = ['Target', 'TargetInfo', 'TargetMC', 'AsmPrinter'] postfixes = ['Target', 'TargetInfo', 'TargetMC', 'AsmPrinter', 'AsmParser']
try: try:
for postfix in postfixes: for postfix in postfixes:
getattr(api, '%s%s%s' % (prefix, target, postfix))() getattr(api, '%s%s%s' % (prefix, target, postfix))()

View file

@ -30,6 +30,7 @@
#include <llvm/PassRegistry.h> #include <llvm/PassRegistry.h>
#include <llvm/Support/Host.h> #include <llvm/Support/Host.h>
#include <llvm/ExecutionEngine/MCJIT.h> // to make MCJIT working
#include "auto_pyobject.h" #include "auto_pyobject.h"

View file

@ -101,3 +101,5 @@ class ExecutionEngine:
unwrapped = list(map(capsule.unwrap, args)) unwrapped = list(map(capsule.unwrap, args))
return self._runFunction(fn, tuple(unwrapped)) return self._runFunction(fn, tuple(unwrapped))
finalizeObject = Method(Void)

View file

@ -124,7 +124,7 @@ else:
extra_components = list(extra_components & enabled_components) extra_components = list(extra_components & enabled_components)
libs_core, objs_core = get_libs_and_objs( libs_core, objs_core = get_libs_and_objs(
['core', 'analysis', 'scalaropts', 'executionengine', ['core', 'analysis', 'scalaropts', 'executionengine', 'mcjit',
'jit', 'native', 'interpreter', 'bitreader', 'bitwriter', 'jit', 'native', 'interpreter', 'bitreader', 'bitwriter',
'instrumentation', 'ipa', 'ipo', 'transformutils', 'instrumentation', 'ipa', 'ipo', 'transformutils',
'asmparser', 'linker', 'support', 'vectorize'] 'asmparser', 'linker', 'support', 'vectorize']