diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-07-01 12:54:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 12:54:35 -0700 |
commit | dd5df27d9c6b47793b72d4c8f2a796e5d8dc343d (patch) | |
tree | 6d90fab240c199b8f2f97df2976a2edeeedb1ccf /lldb/source/Commands/CommandObjectSource.cpp | |
parent | 668ee3f5478c1e1b549923667cf1b8704b1a0bd0 (diff) | |
download | llvm-dd5df27d9c6b47793b72d4c8f2a796e5d8dc343d.zip llvm-dd5df27d9c6b47793b72d4c8f2a796e5d8dc343d.tar.gz llvm-dd5df27d9c6b47793b72d4c8f2a796e5d8dc343d.tar.bz2 |
[lldb] Make semantics of SupportFile equivalence explicit (#97126)
This is an improved attempt to improve the semantics of SupportFile
equivalence, taking into account the feedback from #95606.
Pavel's comment about the lack of a concise name because the concept
isn't trivial made me realize that I don't want to abstract this concept
away behind a helper function. Instead, I opted for a rather verbose
enum that forces the caller to consider exactly what kind of comparison
is appropriate for every call.
Diffstat (limited to 'lldb/source/Commands/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 0c12674..f54b712 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -747,13 +747,17 @@ protected: bool operator==(const SourceInfo &rhs) const { return function == rhs.function && - *line_entry.original_file_sp == *rhs.line_entry.original_file_sp && + line_entry.original_file_sp->Equal( + *rhs.line_entry.original_file_sp, + SupportFile::eEqualFileSpecAndChecksumIfSet) && line_entry.line == rhs.line_entry.line; } bool operator!=(const SourceInfo &rhs) const { return function != rhs.function || - *line_entry.original_file_sp != *rhs.line_entry.original_file_sp || + !line_entry.original_file_sp->Equal( + *rhs.line_entry.original_file_sp, + SupportFile::eEqualFileSpecAndChecksumIfSet) || line_entry.line != rhs.line_entry.line; } |