diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-25 03:19:12 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-25 03:19:12 +0000 |
commit | 7467e5ed1c04887c8d7bdb760df346f518003f07 (patch) | |
tree | 4d20bcc820dfe5562f53612eabcc3bb1fe745008 /lib/ExecutionEngine | |
parent | 3d3cc32f5fe815b7a38c2cb558b9d5f40fb0bbb1 (diff) | |
download | external_llvm-7467e5ed1c04887c8d7bdb760df346f518003f07.zip external_llvm-7467e5ed1c04887c8d7bdb760df346f518003f07.tar.gz external_llvm-7467e5ed1c04887c8d7bdb760df346f518003f07.tar.bz2 |
Revert "Exposing MCJIT through C API"
This reverts commit 8c31b298149ca3c3f2bbd9e8aa9a01c4d91f3d74.
It looks like this commit broke some bots:
http://lab.llvm.org:8011/builders/llvm-ppc64-linux2/builds/5209
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngineBindings.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/lib/ExecutionEngine/ExecutionEngineBindings.cpp index 61b2a2a..3e6dcdf 100644 --- a/lib/ExecutionEngine/ExecutionEngineBindings.cpp +++ b/lib/ExecutionEngine/ExecutionEngineBindings.cpp @@ -15,7 +15,6 @@ #include "llvm-c/ExecutionEngine.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/Support/ErrorHandling.h" #include <cstring> @@ -153,47 +152,6 @@ LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, return 1; } -LLVMBool LLVMCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, - LLVMModuleRef M, - LLVMMCJITCompilerOptions *PassedOptions, - size_t SizeOfPassedOptions, - char **OutError) { - LLVMMCJITCompilerOptions options; - // If the user passed a larger sized options struct, then they were compiled - // against a newer LLVM. Tell them that something is wrong. - if (SizeOfPassedOptions > sizeof(options)) { - *OutError = strdup( - "Refusing to use options struct that is larger than my own; assuming LLVM " - "library mismatch."); - return 1; - } - - // Defend against the user having an old version of the API by ensuring that - // any fields they didn't see are cleared. We must defend against fields being - // set to the bitwise equivalent of zero, and assume that this means "do the - // default" as if that option hadn't been available. - memset(&options, 0, sizeof(options)); - memcpy(&options, PassedOptions, SizeOfPassedOptions); - - TargetOptions targetOptions; - targetOptions.NoFramePointerElim = options.NoFramePointerElim; - - std::string Error; - EngineBuilder builder(unwrap(M)); - builder.setEngineKind(EngineKind::JIT) - .setErrorStr(&Error) - .setUseMCJIT(true) - .setOptLevel((CodeGenOpt::Level)options.OptLevel) - .setJITMemoryManager(new SectionMemoryManager()) - .setTargetOptions(targetOptions); - if (ExecutionEngine *JIT = builder.create()) { - *OutJIT = wrap(JIT); - return 0; - } - *OutError = strdup(Error.c_str()); - return 1; -} - LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE, LLVMModuleProviderRef MP, char **OutError) { @@ -238,8 +196,6 @@ void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) { int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned ArgC, const char * const *ArgV, const char * const *EnvP) { - unwrap(EE)->finalizeObject(); - std::vector<std::string> ArgVec; for (unsigned I = 0; I != ArgC; ++I) ArgVec.push_back(ArgV[I]); @@ -250,8 +206,6 @@ int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned NumArgs, LLVMGenericValueRef *Args) { - unwrap(EE)->finalizeObject(); - std::vector<GenericValue> ArgVec; ArgVec.reserve(NumArgs); for (unsigned I = 0; I != NumArgs; ++I) @@ -314,7 +268,5 @@ void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, } void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global) { - unwrap(EE)->finalizeObject(); - return unwrap(EE)->getPointerToGlobal(unwrap<GlobalValue>(Global)); } |