aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/MCJIT/MCJIT.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-07 03:12:54 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-07 03:12:54 +0000
commit701529b2488477d1887c2975677a574d1e90389f (patch)
tree624b1c3253110eb2f43dfd610c6a05b84b0878cf /lib/ExecutionEngine/MCJIT/MCJIT.cpp
parentbe91117c4d719fe15743f21cd5ac9aaf6654c8ab (diff)
downloadexternal_llvm-701529b2488477d1887c2975677a574d1e90389f.zip
external_llvm-701529b2488477d1887c2975677a574d1e90389f.tar.gz
external_llvm-701529b2488477d1887c2975677a574d1e90389f.tar.bz2
Revert ExecutionEngine patches, they either failed to build or broke unit tests.
Please ensure the build is clean and tests are passing when recommitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index f54d040..3d4ee36 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -38,12 +38,24 @@ ExecutionEngine *MCJIT::createJIT(Module *M,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- TargetMachine *TM) {
+ CodeModel::Model CMM,
+ StringRef MArch,
+ StringRef MCPU,
+ const SmallVectorImpl<std::string>& MAttrs) {
// Try to register the program as a source of symbols to resolve against.
//
// FIXME: Don't do this here.
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
+ // Pick a target either via -march or by guessing the native arch.
+ //
+ // FIXME: This should be lifted out of here, it isn't something which should
+ // be part of the JIT policy, rather the burden for this selection should be
+ // pushed to clients.
+ TargetMachine *TM = MCJIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
+ if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
+ TM->setCodeModel(CMM);
+
// If the target supports JIT code generation, create the JIT.
if (TargetJITInfo *TJ = TM->getJITInfo())
return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM), OptLevel,