Add ability to set code model within the execution engine builders

and creation interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2009-11-17 21:58:16 +00:00
parent 6c8a0715c4
commit 88b5aca20a
4 changed files with 29 additions and 10 deletions

View File

@@ -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()) {

View File

@@ -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);