Improve JIT error message for users crazy enough to use -march with JIT, and
authorDaniel Dunbar <daniel@zuster.org>
Tue, 8 Sep 2009 23:32:35 +0000 (23:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 8 Sep 2009 23:32:35 +0000 (23:32 +0000)
mention -version in messages about missing targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81272 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/TargetSelect.cpp
lib/Support/TargetRegistry.cpp

index 2c105416cc7082e544f687f0f2aec669597f75e3..8bed33bb7d42c9dc7bc6d758d5200145b8927884 100644 (file)
@@ -26,7 +26,8 @@
 using namespace llvm;
 
 static cl::opt<std::string>
-MArch("march", cl::desc("Architecture to generate assembly for (see --version)"));
+MArch("march",
+      cl::desc("Architecture to generate assembly for (see --version)"));
 
 static cl::opt<std::string>
 MCPU("mcpu",
@@ -61,7 +62,8 @@ TargetMachine *JIT::selectTarget(ModuleProvider *MP, std::string *ErrorStr) {
     }
 
     if (!TheTarget) {
-      errs() << "JIT: error: invalid target '" << MArch << "'.\n";
+      *ErrorStr = "No available targets are compatible with this -march, "
+        "see -version for the available targets.\n";
       return 0;
     }
 
index 79f30a71f2b57db3eebd69eb080269198feb3251..5896447f5ea5f2b6c8949337248971d880dd780b 100644 (file)
@@ -40,7 +40,8 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT,
   }
 
   if (!Best) {
-    Error = "No available targets are compatible with this triple";
+    Error = "No available targets are compatible with this triple, "
+      "see -version for the available targets.";
     return 0;
   }