rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.14k stars 12.8k forks source link

Consider emitting LLVM DIFile checksums. #68980

Closed eddyb closed 4 years ago

eddyb commented 4 years ago

We already hash the contents of SourceFiles to determine whether the file on disk (if it even exists) still has the same contents, across crates.

I came across LLVM supporting MD5 and SHA1 checksums for DIFiles, and I'm wondering if it could be useful in a similar way - perhaps debuggers would be able to detect changed sources?

cc @michaelwoerister

bjorn3 commented 4 years ago

I'm wondering if it could be useful in a similar way - perhaps debuggers would be able to detect changed sources?

Yes, that is the purpose of the hash, see DWARF5 section 6.2.4.1 opcode DW_LNCT_MD5.