diff options
-rw-r--r-- | tools/driver/driver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index ea218d5403d83..de14425d36162 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -290,9 +290,9 @@ static void SetInstallDir(SmallVectorImpl<const char *> &argv, if (CanonicalPrefixes) llvm::sys::fs::make_absolute(InstalledPath); - InstalledPath = llvm::sys::path::parent_path(InstalledPath); - if (llvm::sys::fs::exists(InstalledPath.c_str())) - TheDriver.setInstalledDir(InstalledPath); + StringRef InstalledPathParent(llvm::sys::path::parent_path(InstalledPath)); + if (llvm::sys::fs::exists(InstalledPathParent)) + TheDriver.setInstalledDir(InstalledPathParent); } static int ExecuteCC1Tool(ArrayRef<const char *> argv, StringRef Tool) { |