[Lldb-commits] [lldb] [lldb] Add Checksum to FileSpec (PR #71457)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 6 17:06:01 PST 2023


================
@@ -420,13 +428,17 @@ class FileSpec {
   ///   The lifetime of the StringRefs is tied to the lifetime of the FileSpec.
   std::vector<llvm::StringRef> GetComponents() const;
 
+  /// Return the checksum for this FileSpec or all zeros if there is none.
+  const Checksum &GetChecksum() const { return m_checksum; };
+
 protected:
   // Convenience method for setting the file without changing the style.
   void SetFile(llvm::StringRef path);
 
   /// Called anytime m_directory or m_filename is changed to clear any cached
   /// state in this object.
   void PathWasModified() {
+    m_checksum = Checksum();
----------------
medismailben wrote:

Would be nice to recompute the checksum if the path was changed. 

https://github.com/llvm/llvm-project/pull/71457


More information about the lldb-commits mailing list