aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-15 11:36:15 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-15 11:36:15 +0000
commitc9274a5c71bca0f4142f863443d62aade451d5ce (patch)
treeb5d2920d974cdefd643a2ac3b4278587d5f0f4ac /lib/ExecutionEngine
parent951148ced5a9214ca52ca1b4647ef253321e816f (diff)
downloadexternal_llvm-c9274a5c71bca0f4142f863443d62aade451d5ce.zip
external_llvm-c9274a5c71bca0f4142f863443d62aade451d5ce.tar.gz
external_llvm-c9274a5c71bca0f4142f863443d62aade451d5ce.tar.bz2
Migrate llc and the JIT to using the TargetRegistry for lookups.
- They still use the TargetMachineRegistry to populate the contents of the -march option (via the listener interface). We can't just populate it in the option parser because we can't expect the TargetRegistry to be populated yet (we no longer rely on static constructors). - There are a couple ways to finish killing off TargetMachineRegistry, but I haven't figured out the cleanest one yet... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/TargetSelect.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp
index 24dd013..a4157bc 100644
--- a/lib/ExecutionEngine/JIT/TargetSelect.cpp
+++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp
@@ -45,16 +45,16 @@ ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool AllocateGVsWithCode) {
- const TargetMachineRegistry::entry *TheArch = MArch;
- if (TheArch == 0) {
+ const Target *TheTarget;
+ if (MArch == 0) {
std::string Error;
- TheArch = TargetMachineRegistry::getClosestTargetForJIT(Error);
- if (TheArch == 0) {
+ TheTarget = TargetRegistry::getClosestTargetForJIT(Error);
+ if (TheTarget == 0) {
if (ErrorStr)
*ErrorStr = Error;
return 0;
}
- } else if (TheArch->JITMatchQualityFn() == 0) {
+ } else if (TheTarget->getJITMatchQuality() == 0) {
cerr << "WARNING: This target JIT is not designed for the host you are"
<< " running. If bad things happen, please choose a different "
<< "-march switch.\n";
@@ -71,7 +71,8 @@ ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr,
}
// Allocate a target...
- TargetMachine *Target = TheArch->CtorFn(*MP->getModule(), FeaturesStr);
+ TargetMachine *Target =
+ TheTarget->createTargetMachine(*MP->getModule(), FeaturesStr);
assert(Target && "Could not allocate target machine!");
// If the target supports JIT code generation, return a new JIT now.