diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-15 11:36:15 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-15 11:36:15 +0000 |
commit | 54785e6df01aa239759a5717d7cc115387e34559 (patch) | |
tree | b5d2920d974cdefd643a2ac3b4278587d5f0f4ac /lib/ExecutionEngine/JIT/TargetSelect.cpp | |
parent | 4d1be777f81137bab98025d1c37c08ef0ec2f204 (diff) |
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/JIT/TargetSelect.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/TargetSelect.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp index 24dd013639..a4157bcd7b 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. |