Provide correct NEON encodings for vaddl.u* and vaddl.s*.
[oota-llvm.git] / lib / Support / SystemUtils.cpp
index 3d3649eaebabfe4403c2bd148d2f596d58a96f2b..c8b260c2e3dd9b4174fa224c9e124b0a11b2c5e7 100644 (file)
@@ -20,8 +20,7 @@ using namespace llvm;
 
 bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
                                        bool print_warning) {
-  if (&stream_to_check == &outs() &&
-      sys::Process::StandardOutIsDisplayed()) {
+  if (stream_to_check.is_displayed()) {
     if (print_warning) {
       errs() << "WARNING: You're attempting to print out a bitcode file.\n"
              << "This is inadvisable as it may cause display problems. If\n"
@@ -50,6 +49,16 @@ sys::Path llvm::FindExecutable(const std::string &ExeName,
     Result.appendComponent(ExeName);
     if (Result.canExecute())
       return Result;
+    // If the path is absolute (and it usually is), call FindProgramByName to
+    // allow it to try platform-specific logic, such as appending a .exe suffix
+    // on Windows. Don't do this if we somehow have a relative path, because
+    // we don't want to go searching the PATH and accidentally find an unrelated
+    // version of the program.
+    if (Result.isAbsolute()) {
+      Result = sys::Program::FindProgramByName(Result.str());
+      if (!Result.empty())
+        return Result;
+    }
   }
 
   return sys::Path();