diff options
author | Frederic Riss <friss@apple.com> | 2015-03-10 03:47:55 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2015-03-10 03:47:55 +0000 |
commit | 44a219f0a00e498254d4be8ec031d0e00a54f9a2 (patch) | |
tree | 9c539ae517cd07df072a5522264c480f98e3f394 /llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp | |
parent | c6012545faf7227fed7fc6a55d62c19bf97d5125 (diff) | |
download | bcm5719-llvm-44a219f0a00e498254d4be8ec031d0e00a54f9a2.tar.gz bcm5719-llvm-44a219f0a00e498254d4be8ec031d0e00a54f9a2.zip |
DwarfAccelTable: remove unneeded bucket terminators.
Last commit fixed the handling of hash collisions, but it introdcuced
unneeded bucket terminators in some places. The generated table was
correct, it can just be a tiny bit smaller. As the previous table was
correct, the test doesn't need updating. If we really wanted to test
this, I could add the section size to the dwarf dump and test for a
precise value there. IMO the correctness test is sufficient.
llvm-svn: 231748
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp index 09c47356adc..c19325952b1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp @@ -205,8 +205,8 @@ void DwarfAccelTable::EmitOffsets(AsmPrinter *Asm, MCSymbol *SecBegin) { // Terminate each HashData bucket with 0. void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfDebug *D, MCSymbol *StrSym) { - uint64_t PrevHash = UINT64_MAX; for (size_t i = 0, e = Buckets.size(); i < e; ++i) { + uint64_t PrevHash = UINT64_MAX; for (HashList::const_iterator HI = Buckets[i].begin(), HE = Buckets[i].end(); HI != HE; ++HI) { @@ -235,7 +235,8 @@ void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfDebug *D, PrevHash = (*HI)->HashValue; } // Emit the final end marker for the bucket. - Asm->EmitInt32(0); + if (!Buckets[i].empty()) + Asm->EmitInt32(0); } } |