Improve JIT error message for users crazy enough to use -march with JIT, and
[oota-llvm.git] / lib / ExecutionEngine / JIT / TargetSelect.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;
     }