From 5eb97005788068e0177ce0f69dc777515ee93e4e Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 15 Jul 2009 11:36:15 +0000 Subject: 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... llvm-svn: 75773 --- llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp') diff --git a/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp b/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp index 24dd0136398..a4157bcd7b2 100644 --- a/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp +++ b/llvm/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. -- cgit v1.2.3