Simplify address pool index assignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206905 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-04-22 17:21:40 +00:00
parent 3682fdabef
commit 795e462cc4
2 changed files with 2 additions and 6 deletions

View File

@ -257,9 +257,7 @@ unsigned DwarfFile::getStringPoolIndex(StringRef Str) {
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;
}

View File

@ -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();