mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 09:53:54 +00:00
Simplify address pool index assignment.
llvm-svn: 206905
This commit is contained in:
parent
f022fe68e4
commit
9010d1345e
@ -257,9 +257,7 @@ unsigned DwarfFile::getStringPoolIndex(StringRef Str) {
|
|||||||
|
|
||||||
unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym, bool TLS) {
|
unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym, bool TLS) {
|
||||||
std::pair<AddrPool::iterator, bool> P = AddressPool.insert(
|
std::pair<AddrPool::iterator, bool> P = AddressPool.insert(
|
||||||
std::make_pair(Sym, AddressPoolEntry(NextAddrPoolNumber, TLS)));
|
std::make_pair(Sym, AddressPoolEntry(AddressPool.size(), TLS)));
|
||||||
if (P.second)
|
|
||||||
++NextAddrPoolNumber;
|
|
||||||
return P.first->second.Number;
|
return P.first->second.Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,12 +166,10 @@ class DwarfFile {
|
|||||||
// references.
|
// references.
|
||||||
typedef DenseMap<const MCSymbol *, AddressPoolEntry> AddrPool;
|
typedef DenseMap<const MCSymbol *, AddressPoolEntry> AddrPool;
|
||||||
AddrPool AddressPool;
|
AddrPool AddressPool;
|
||||||
unsigned NextAddrPoolNumber;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA)
|
DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA)
|
||||||
: Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref),
|
: Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {}
|
||||||
AddressPool(), NextAddrPoolNumber(0) {}
|
|
||||||
|
|
||||||
~DwarfFile();
|
~DwarfFile();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user