Revert 356905

Commited from wrong directory...

llvm-svn: 356907
This commit is contained in:
Serge Guelton 2019-03-25 15:18:55 +00:00
parent b833c6af59
commit dcb128f73b

View File

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