diff options
| author | Eric Christopher <echristo@apple.com> | 2009-11-17 21:58:16 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2009-11-17 21:58:16 +0000 |
| commit | 700d08e18d777c146265da5d00247b26cecead4b (patch) | |
| tree | b4a97b39f151cfc6aa4889a1ef02f51e575e8483 /llvm/lib/ExecutionEngine/JIT | |
| parent | 50ee5e7ddb4b56b703359bd0e50e786013f494d6 (diff) | |
| download | bcm5719-llvm-700d08e18d777c146265da5d00247b26cecead4b.tar.gz bcm5719-llvm-700d08e18d777c146265da5d00247b26cecead4b.zip | |
Add ability to set code model within the execution engine builders
and creation interfaces.
llvm-svn: 89151
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JIT.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JIT.h | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp index 0e068185774..6d781c7e22c 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp @@ -198,15 +198,17 @@ ExecutionEngine *ExecutionEngine::createJIT(ModuleProvider *MP, std::string *ErrorStr, JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, - bool GVsWithCode) { - return JIT::createJIT(MP, ErrorStr, JMM, OptLevel, GVsWithCode); + bool GVsWithCode, + CodeModel::Model CMM) { + return JIT::createJIT(MP, ErrorStr, JMM, OptLevel, GVsWithCode, CMM); } ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr, JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, - bool GVsWithCode) { + bool GVsWithCode, + CodeModel::Model CMM) { // Make sure we can resolve symbols in the program as well. The zero arg // to the function tells DynamicLibrary to load the program, not a library. if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr)) @@ -215,6 +217,7 @@ ExecutionEngine *JIT::createJIT(ModuleProvider *MP, // Pick a target either via -march or by guessing the native arch. TargetMachine *TM = JIT::selectTarget(MP, ErrorStr); if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0; + TM->setCodeModel(CMM); // If the target supports JIT code generation, create a the JIT. if (TargetJITInfo *TJ = TM->getJITInfo()) { diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.h b/llvm/lib/ExecutionEngine/JIT/JIT.h index 6659e754338..f165bd6659e 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.h +++ b/llvm/lib/ExecutionEngine/JIT/JIT.h @@ -85,8 +85,10 @@ public: JITMemoryManager *JMM, CodeGenOpt::Level OptLevel = CodeGenOpt::Default, - bool GVsWithCode = true) { - return ExecutionEngine::createJIT(MP, Err, JMM, OptLevel, GVsWithCode); + bool GVsWithCode = true, + CodeModel::Model CMM = CodeModel::Default) { + return ExecutionEngine::createJIT(MP, Err, JMM, OptLevel, GVsWithCode, + CMM); } virtual void addModuleProvider(ModuleProvider *MP); @@ -175,7 +177,8 @@ public: std::string *ErrorStr, JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, - bool GVsWithCode); + bool GVsWithCode, + CodeModel::Model CMM); // Run the JIT on F and return information about the generated code void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0); |

