diff options
| author | Zachary Turner <zturner@google.com> | 2017-03-06 23:42:44 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-03-06 23:42:44 +0000 |
| commit | 8c6b546dfd93409aec97534929ffd2143c279ccc (patch) | |
| tree | 7caf0e0658933672406b5cde4a8afca9f03e8906 | |
| parent | 7f6a7a37521e3610be7242ccec7ca9a15c1c307a (diff) | |
| download | bcm5719-llvm-8c6b546dfd93409aec97534929ffd2143c279ccc.tar.gz bcm5719-llvm-8c6b546dfd93409aec97534929ffd2143c279ccc.zip | |
Remove dependency from FileSpec to ArchSpec.
All it really needs is the llvm::Triple, so make FileSpec take
the Triple directly instead of the ArchSpec.
llvm-svn: 297096
| -rw-r--r-- | lldb/include/lldb/Host/FileSpec.h | 7 | ||||
| -rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 17 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 7 |
3 files changed, 17 insertions, 14 deletions
diff --git a/lldb/include/lldb/Host/FileSpec.h b/lldb/include/lldb/Host/FileSpec.h index f7123a016cf..755fa034189 100644 --- a/lldb/include/lldb/Host/FileSpec.h +++ b/lldb/include/lldb/Host/FileSpec.h @@ -21,6 +21,7 @@ #include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" +#include "llvm/ADT/Triple.h" #include "llvm/Support/FormatVariadic.h" namespace lldb_private { @@ -84,7 +85,8 @@ public: explicit FileSpec(llvm::StringRef path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative); - explicit FileSpec(llvm::StringRef path, bool resolve_path, ArchSpec arch); + explicit FileSpec(llvm::StringRef path, bool resolve_path, + const llvm::Triple &Triple); //------------------------------------------------------------------ /// Copy constructor @@ -520,7 +522,8 @@ public: void SetFile(llvm::StringRef path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative); - void SetFile(llvm::StringRef path, bool resolve_path, ArchSpec arch); + void SetFile(llvm::StringRef path, bool resolve_path, + const llvm::Triple &Triple); bool IsResolved() const { return m_is_resolved; } diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 4867592db58..ef7df3cddd5 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -25,7 +25,6 @@ #include <pwd.h> #endif -#include "lldb/Core/ArchSpec.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Utility/CleanUp.h" @@ -284,10 +283,10 @@ FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, PathSyntax syntax) SetFile(path, resolve_path, syntax); } -FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, ArchSpec arch) - : FileSpec{path, resolve_path, arch.GetTriple().isOSWindows() - ? ePathSyntaxWindows - : ePathSyntaxPosix} {} +FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, + const llvm::Triple &Triple) + : FileSpec{path, resolve_path, + Triple.isOSWindows() ? ePathSyntaxWindows : ePathSyntaxPosix} {} //------------------------------------------------------------------ // Copy constructor @@ -374,10 +373,10 @@ void FileSpec::SetFile(llvm::StringRef pathname, bool resolve, : resolve_path_ref.substr(filename_begin)); } -void FileSpec::SetFile(llvm::StringRef path, bool resolve, ArchSpec arch) { - return SetFile(path, resolve, arch.GetTriple().isOSWindows() - ? ePathSyntaxWindows - : ePathSyntaxPosix); +void FileSpec::SetFile(llvm::StringRef path, bool resolve, + const llvm::Triple &Triple) { + return SetFile(path, resolve, + Triple.isOSWindows() ? ePathSyntaxWindows : ePathSyntaxPosix); } //---------------------------------------------------------------------- diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index f7353888f8c..5f5dd3e79d5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1660,7 +1660,7 @@ bool GDBRemoteCommunicationClient::GetWorkingDir(FileSpec &working_dir) { return false; std::string cwd; response.GetHexByteString(cwd); - working_dir.SetFile(cwd, false, GetHostArchitecture()); + working_dir.SetFile(cwd, false, GetHostArchitecture().GetTriple()); return !cwd.empty(); } return false; @@ -3191,7 +3191,7 @@ bool GDBRemoteCommunicationClient::GetModuleInfo( StringExtractor extractor(value); std::string path; extractor.GetHexByteString(path); - module_spec.GetFileSpec() = FileSpec(path, false, arch_spec); + module_spec.GetFileSpec() = FileSpec(path, false, arch_spec.GetTriple()); } } @@ -3225,7 +3225,8 @@ ParseModuleSpec(StructuredData::Dictionary *dict) { if (!dict->GetValueForKeyAsString("file_path", string)) return llvm::None; - result.GetFileSpec() = FileSpec(string, false, result.GetArchitecture()); + result.GetFileSpec() = + FileSpec(string, false, result.GetArchitecture().GetTriple()); return result; } |

