This revision was automatically updated to reflect the committed changes.
Closed by commit rL356905: Python 2/3 compat: queue vs Queue (authored by 
serge_sans_paille, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59590?vs=191454&id=192111#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59590/new/

https://reviews.llvm.org/D59590

Files:
  llvm/trunk/tools/llvm-config/llvm-config.cpp


Index: llvm/trunk/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.cpp
+++ llvm/trunk/tools/llvm-config/llvm-config.cpp
@@ -268,7 +268,6 @@
   // tree.
   bool IsInDevelopmentTree;
   enum { CMakeStyle, CMakeBuildModeStyle } DevelopmentTreeLayout;
-  llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]));
   std::string CurrentExecPrefix;
   std::string ActiveObjRoot;
 
@@ -279,11 +278,18 @@
     build_mode = CMAKE_CFG_INTDIR;
 #endif
 
-  // Create an absolute path, and pop up one directory (we expect to be inside 
a
-  // bin dir).
-  sys::fs::make_absolute(CurrentPath);
-  CurrentExecPrefix =
-      sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
+  // Create an absolute path, and pop up as much directory as in
+  // LLVM_TOOLS_INSTALL_DIR
+  {
+    llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]));
+    sys::fs::make_absolute(CurrentPath);
+    for (auto iter = sys::path::begin(LLVM_TOOLS_INSTALL_DIR),
+              end = sys::path::end(LLVM_TOOLS_INSTALL_DIR);
+         iter != end; ++iter) {
+      CurrentPath = sys::path::parent_path(CurrentPath).str();
+    }
+    CurrentExecPrefix = sys::path::parent_path(CurrentPath).str();
+  }
 
   // Check to see if we are inside a development tree by comparing to possible
   // locations (prefix style or CMake style).


Index: llvm/trunk/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.cpp
+++ llvm/trunk/tools/llvm-config/llvm-config.cpp
@@ -268,7 +268,6 @@
   // tree.
   bool IsInDevelopmentTree;
   enum { CMakeStyle, CMakeBuildModeStyle } DevelopmentTreeLayout;
-  llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]));
   std::string CurrentExecPrefix;
   std::string ActiveObjRoot;
 
@@ -279,11 +278,18 @@
     build_mode = CMAKE_CFG_INTDIR;
 #endif
 
-  // Create an absolute path, and pop up one directory (we expect to be inside a
-  // bin dir).
-  sys::fs::make_absolute(CurrentPath);
-  CurrentExecPrefix =
-      sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
+  // Create an absolute path, and pop up as much directory as in
+  // LLVM_TOOLS_INSTALL_DIR
+  {
+    llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]));
+    sys::fs::make_absolute(CurrentPath);
+    for (auto iter = sys::path::begin(LLVM_TOOLS_INSTALL_DIR),
+              end = sys::path::end(LLVM_TOOLS_INSTALL_DIR);
+         iter != end; ++iter) {
+      CurrentPath = sys::path::parent_path(CurrentPath).str();
+    }
+    CurrentExecPrefix = sys::path::parent_path(CurrentPath).str();
+  }
 
   // Check to see if we are inside a development tree by comparing to possible
   // locations (prefix style or CMake style).
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to