gollvm: search install dir before system dirs in getFilePath

In case that there is an installed libgo in the system (from
gccgo installation), we want to pick our libgo instead of the
system one. This is not an issue in linking, where we do pass
our install dir before system dirs to ld, but for things like
-print-file-name.

Change-Id: I39379f5e84d40e511472176b25eef5ab182fe71f
Reviewed-on: https://go-review.googlesource.com/118635
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/driver/Driver.cpp b/driver/Driver.cpp
index 9485616..d7893f2 100644
--- a/driver/Driver.cpp
+++ b/driver/Driver.cpp
@@ -85,6 +85,12 @@
       return cand;
   }
 
+  // Examine install dir
+  llvm::SmallString<256> installed(installedLibDir());
+  llvm::sys::path::append(installed, name);
+  if (llvm::sys::fs::exists(llvm::Twine(installed)))
+    return installed.str();
+
   // Examine toolchain file paths.
   for (const auto &dir : toolchain.filePaths()) {
     llvm::SmallString<256> candidate(dir);
@@ -93,12 +99,6 @@
       return candidate.str();
   }
 
-  // System install dir
-  llvm::SmallString<256> installed(installedLibDir());
-  llvm::sys::path::append(installed, name);
-  if (llvm::sys::fs::exists(llvm::Twine(installed)))
-    return installed.str();
-
   return name;
 }