This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.
Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.
Fixes PR38609.
Instead of MD5, can we use xxhash (or whatever the fastest hash algorithm in LLVM is these days)? I don't think we need a particular hash algorithm, so we might as well go with the fastest one we have (as long as it does a good job avoiding collisions, of course).