Lookup targets by Triple instead of Module.
llvm-svn: 77108
This commit is contained in:
parent
397792d981
commit
6a82e424d0
|
@ -205,8 +205,9 @@ bool BackendConsumer::AddEmitPasses(std::string &Error) {
|
|||
bool Fast = CompileOpts.OptimizationLevel == 0;
|
||||
|
||||
// Create the TargetMachine for generating code.
|
||||
std::string Triple = TheModule->getTargetTriple();
|
||||
const llvm::Target *TheTarget =
|
||||
TargetRegistry::getClosestStaticTargetForModule(*TheModule, Error);
|
||||
TargetRegistry::getClosestStaticTargetForTriple(Triple, Error);
|
||||
if (!TheTarget) {
|
||||
Error = std::string("Unable to get target machine: ") + Error;
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue