summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit58799a35e50e93dee4d0403178d9694113582a0e (patch)
treed372657fdf519537d74d9ad6e08aba0ef224ac4d /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
parentde756fbbd711a0b5c8c05e6817f35307d496eec4 (diff)
downloadbcm5719-llvm-58799a35e50e93dee4d0403178d9694113582a0e.tar.gz
bcm5719-llvm-58799a35e50e93dee4d0403178d9694113582a0e.zip
Revert ExecutionEngine patches, they either failed to build or broke unit tests.
Please ensure the build is clean and tests are passing when recommitting. llvm-svn: 131044
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index f54d040fbc1..3d4ee369ead 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud