]> granicus.if.org Git - llvm/commit
DebugInfo: Include .dwo file name when hashing multiple CUs in a single file
authorMehdi Amini <joker.eph@gmail.com>
Mon, 29 May 2017 06:32:34 +0000 (06:32 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 29 May 2017 06:32:34 +0000 (06:32 +0000)
commit2ef4cb9ee0736736daca369d3a3e7da292e0dd54
treeec315cd597a05e17652fa73cedbacb3ea8c53b83
parentd8c1a8e00db9b5faafc99258454fda00859234ff
DebugInfo: Include .dwo file name when hashing multiple CUs in a single file

This is really a workaround for ThinLTO in particular - since it can
import partial CUs that may end up looking very similar/the same as
the same partial import in another ThinLTO compile.

An alternative fix would be to change the DICompileUnit metadata to
include a "primary file" or the like - and when importing for ThinLTO
set the primary file to the name of the DICompileUnit that is being
imported into. This involves changing the schema and would reduce the
excessive uniqueness in the hash that this change creates - allowing
diagnosing of more duplicate CUs than will be caught with this change.

But duplicate CUs can still be caught in non-ThinLTO builds & are mostly
a nuisance rather than a particularly deliberate/effective tool for
finding broken code. (arguably the hash could always include the dwo
file and nothing in fission would break, I think..)

Reapply of r304119 after adding a triple to the test and moving it
to the X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304130 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DIEHash.cpp
lib/CodeGen/AsmPrinter/DIEHash.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/split-dwarf-multiple-cu-hash.ll [new file with mode: 0644]