DwarfAccelTable: Fix handling of hash collisions.
authorFrederic Riss <friss@apple.com>
Tue, 10 Mar 2015 00:46:31 +0000 (00:46 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 10 Mar 2015 00:46:31 +0000 (00:46 +0000)
commit0e9a50f5b57198f6649e7c47814611e6f8c86322
treec48936d18169f12aa3dbd95fb688c447e4397bba
parent0c3c1893c4a737613dd402ffb7a9ff5456ae1f5e
DwarfAccelTable: Fix handling of hash collisions.

It turns out accelerator tables where totally broken if they contained
entries with colliding hashes. The failure mode is pretty bad, as it not
only impacted the colliding entries, but would basically make all the
entries after the first hash collision pointing in the wrong place.

The testcase uses the symbol names that where found to collide during a
clang build.

From a performance point of view, the patch adds a sort and a linear
walk over each bucket contents. While it has a measurable impact on the
accelerator table emission, it's not showing up significantly in clang
profiles (and I'd argue that correctness is priceless :-)).

llvm-svn: 231732
llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
llvm/test/DebugInfo/accel-table-hash-collisions.ll [new file with mode: 0644]