diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 63f510db458..7f1bebaf124 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -257,9 +257,7 @@ unsigned DwarfFile::getStringPoolIndex(StringRef Str) { unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym, bool TLS) { std::pair 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; } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 8c4514e615e..363d7650e0b 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -166,12 +166,10 @@ class DwarfFile { // references. typedef DenseMap 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();