diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 21:05:36 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 21:05:36 +0000 |
commit | 8f3be7a32b631e9ba584872c1f0dde8fd8536c07 (patch) | |
tree | b4cfca7eb1e0996decd88a2b1dd1954ff3d7ff28 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 8487d22d12f5b7b5c745e5a5cdda61f8a07391e1 (diff) | |
download | bcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.tar.gz bcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.zip |
[FileSystem] Move path resolution logic out of FileSpec
This patch removes the logic for resolving paths out of FileSpec and
updates call sites to rely on the FileSystem class instead.
Differential revision: https://reviews.llvm.org/D53915
llvm-svn: 345890
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 8f38517f629..564e6e91740 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2087,12 +2087,13 @@ void CommandInterpreter::SourceInitFile(bool in_cwd, LoadCWDlldbinitFile should_load = target->TargetProperties::GetLoadCWDlldbinitFile(); if (should_load == eLoadCWDlldbinitWarn) { - FileSpec dot_lldb(".lldbinit", true); + FileSpec dot_lldb(".lldbinit"); + FileSystem::Instance().Resolve(dot_lldb); llvm::SmallString<64> home_dir_path; llvm::sys::path::home_directory(home_dir_path); - FileSpec homedir_dot_lldb(home_dir_path.c_str(), false); + FileSpec homedir_dot_lldb(home_dir_path.c_str()); homedir_dot_lldb.AppendPathComponent(".lldbinit"); - homedir_dot_lldb.ResolvePath(); + FileSystem::Instance().Resolve(homedir_dot_lldb); if (FileSystem::Instance().Exists(dot_lldb) && dot_lldb.GetDirectory() != homedir_dot_lldb.GetDirectory()) { result.AppendErrorWithFormat( @@ -2111,7 +2112,8 @@ void CommandInterpreter::SourceInitFile(bool in_cwd, return; } } else if (should_load == eLoadCWDlldbinitTrue) { - init_file.SetFile("./.lldbinit", true, FileSpec::Style::native); + init_file.SetFile("./.lldbinit", FileSpec::Style::native); + FileSystem::Instance().Resolve(init_file); } } } else { @@ -2123,7 +2125,7 @@ void CommandInterpreter::SourceInitFile(bool in_cwd, // init files. llvm::SmallString<64> home_dir_path; llvm::sys::path::home_directory(home_dir_path); - FileSpec profilePath(home_dir_path.c_str(), false); + FileSpec profilePath(home_dir_path.c_str()); profilePath.AppendPathComponent(".lldbinit"); std::string init_file_path = profilePath.GetPath(); @@ -2135,15 +2137,15 @@ void CommandInterpreter::SourceInitFile(bool in_cwd, char program_init_file_name[PATH_MAX]; ::snprintf(program_init_file_name, sizeof(program_init_file_name), "%s-%s", init_file_path.c_str(), program_name); - init_file.SetFile(program_init_file_name, true, - FileSpec::Style::native); + init_file.SetFile(program_init_file_name, FileSpec::Style::native); + FileSystem::Instance().Resolve(init_file); if (!FileSystem::Instance().Exists(init_file)) init_file.Clear(); } } if (!init_file && !m_skip_lldbinit_files) - init_file.SetFile(init_file_path, false, FileSpec::Style::native); + init_file.SetFile(init_file_path, FileSpec::Style::native); } // If the file exists, tell HandleCommand to 'source' it; this will do the |