mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
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:
parent
3682fdabef
commit
795e462cc4
@ -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