]> granicus.if.org Git - clang/commitdiff
Lookup targets by Triple instead of Module.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 26 Jul 2009 01:27:26 +0000 (01:27 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 26 Jul 2009 01:27:26 +0000 (01:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77108 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/Backend.cpp

index 2fa4e36749c21788bea330ec7e3af3f448c18818..54d343531d9c3ae12cdb3b60d215fa7046b6702c 100644 (file)
@@ -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;