summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-22 17:21:40 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-22 17:21:40 +0000
commit5f1a0010718216f8ffe7ac93e752e6af129335ef (patch)
treea3f21f86d605ab47de07a0c0d5445f3e53429626 /llvm/lib/CodeGen/AsmPrinter
parent16353871c32c1c9836d32ff56158c04c55dc263c (diff)
downloadbcm5719-llvm-5f1a0010718216f8ffe7ac93e752e6af129335ef.tar.gz
bcm5719-llvm-5f1a0010718216f8ffe7ac93e752e6af129335ef.zip
Simplify address pool index assignment.
llvm-svn: 206905
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h4
2 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 63f510db458..7f1bebaf124 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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;
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 8c4514e615e..363d7650e0b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -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();
OpenPOWER on IntegriCloud