[llvm] r206905 - Simplify address pool index assignment.
David Blaikie
dblaikie at gmail.com
Tue Apr 22 10:21:41 PDT 2014
Author: dblaikie
Date: Tue Apr 22 12:21:40 2014
New Revision: 206905
URL: http://llvm.org/viewvc/llvm-project?rev=206905&view=rev
Log:
Simplify address pool index assignment.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=206905&r1=206904&r2=206905&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Apr 22 12:21:40 2014
@@ -257,9 +257,7 @@ unsigned DwarfFile::getStringPoolIndex(S
unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym, bool TLS) {
std::pair<AddrPool::iterator, bool> P = AddressPool.insert(
- std::make_pair(Sym, AddressPoolEntry(NextAddrPoolNumber, TLS)));
- if (P.second)
- ++NextAddrPoolNumber;
+ std::make_pair(Sym, AddressPoolEntry(AddressPool.size(), TLS)));
return P.first->second.Number;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=206905&r1=206904&r2=206905&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Apr 22 12:21:40 2014
@@ -166,12 +166,10 @@ class DwarfFile {
// references.
typedef DenseMap<const MCSymbol *, AddressPoolEntry> AddrPool;
AddrPool AddressPool;
- unsigned NextAddrPoolNumber;
public:
DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA)
- : Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref),
- AddressPool(), NextAddrPoolNumber(0) {}
+ : Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {}
~DwarfFile();
More information about the llvm-commits
mailing list