aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-01-12 13:03:12 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2024-01-12 13:08:24 -0800
commite27561fc7de0231f2efdb750f2092c3ac807c1a3 (patch)
treee9e40b20e52fc49025de96a8aa7b7ac9ab301d4e /lldb/source
parentdcba077146b92634f6a6b6e86970d59aaf7baf28 (diff)
downloadllvm-e27561fc7de0231f2efdb750f2092c3ac807c1a3.zip
llvm-e27561fc7de0231f2efdb750f2092c3ac807c1a3.tar.gz
llvm-e27561fc7de0231f2efdb750f2092c3ac807c1a3.tar.bz2
[lldb] Move MD5 Checksum from FileSpec to SupportFile
When I added the MD5 checksum I was on the fence between storing it in FileSpec or creating a new SupportFile abstraction. The latter was deemed overkill for just the MD5 hashes, but support for inline sources in the DWARF 5 line table tipped the scales. This patch moves the MD5 checksum into the new SupportFile class.
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp2
-rw-r--r--lldb/source/Utility/FileSpec.cpp9
2 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 1a16b70..3371803 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -294,7 +294,7 @@ static void ParseSupportFilesFromPrologue(
}
// Unconditionally add an entry, so the indices match up.
- support_files.EmplaceBack(remapped_file, style, checksum);
+ support_files.EmplaceBack(FileSpec(remapped_file, style), checksum);
}
}
diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp
index 5387be9..4bebbc9 100644
--- a/lldb/source/Utility/FileSpec.cpp
+++ b/lldb/source/Utility/FileSpec.cpp
@@ -68,9 +68,8 @@ void Denormalize(llvm::SmallVectorImpl<char> &path, FileSpec::Style style) {
FileSpec::FileSpec() : m_style(GetNativeStyle()) {}
// Default constructor that can take an optional full path to a file on disk.
-FileSpec::FileSpec(llvm::StringRef path, Style style, const Checksum &checksum)
- : m_checksum(checksum), m_style(style) {
- SetFile(path, style, checksum);
+FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) {
+ SetFile(path, style);
}
FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &triple)
@@ -172,11 +171,9 @@ void FileSpec::SetFile(llvm::StringRef pathname) { SetFile(pathname, m_style); }
// Update the contents of this object with a new path. The path will be split
// up into a directory and filename and stored as uniqued string values for
// quick comparison and efficient memory usage.
-void FileSpec::SetFile(llvm::StringRef pathname, Style style,
- const Checksum &checksum) {
+void FileSpec::SetFile(llvm::StringRef pathname, Style style) {
Clear();
m_style = (style == Style::native) ? GetNativeStyle() : style;
- m_checksum = checksum;
if (pathname.empty())
return;