mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -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()) {
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user