diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-02-15 19:34:03 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-02-15 19:34:03 +0000 |
commit | f1a6dea82c6b702842af75f2d98e89700bdd800d (patch) | |
tree | aae588144d8372734ead67b98269d2a9fd177a78 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 90181d6180cdfe050dd0cff470499e26b3d61dd5 (diff) | |
download | bcm5719-llvm-f1a6dea82c6b702842af75f2d98e89700bdd800d.tar.gz bcm5719-llvm-f1a6dea82c6b702842af75f2d98e89700bdd800d.zip |
DebugInfo: Deduplicate entries in the fission address table
This broke in r185459 while TLS support was being generalized to handle
non-symbol TLS representations.
I thought about/tried having an enum rather than a bool to track the
TLS-ness of the address table entry, but namespaces and naming seemed
more hassle than it was worth for only one caller that needed to specify
this.
llvm-svn: 201469
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4a7abe50e65..70db96e43a1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -265,16 +265,12 @@ unsigned DwarfFile::getStringPoolIndex(StringRef Str) { return Entry.second; } -unsigned DwarfFile::getAddrPoolIndex(const MCSymbol *Sym) { - return getAddrPoolIndex(MCSymbolRefExpr::Create(Sym, Asm->OutContext)); -} - -unsigned DwarfFile::getAddrPoolIndex(const MCExpr *Sym) { - std::pair<DenseMap<const MCExpr *, unsigned>::iterator, bool> P = - AddressPool.insert(std::make_pair(Sym, NextAddrPoolNumber)); +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; - return P.first->second; + return P.first->second.Number; } // Define a unique number for the abbreviation. @@ -2548,10 +2544,12 @@ void DwarfFile::emitAddresses(const MCSection *AddrSection) { // Order the address pool entries by ID SmallVector<const MCExpr *, 64> Entries(AddressPool.size()); - for (DenseMap<const MCExpr *, unsigned>::iterator I = AddressPool.begin(), - E = AddressPool.end(); + for (AddrPool::iterator I = AddressPool.begin(), E = AddressPool.end(); I != E; ++I) - Entries[I->second] = I->first; + Entries[I->second.Number] = + I->second.TLS + ? Asm->getObjFileLowering().getDebugThreadLocalSymbol(I->first) + : MCSymbolRefExpr::Create(I->first, Asm->OutContext); for (unsigned i = 0, e = Entries.size(); i != e; ++i) Asm->OutStreamer.EmitValue(Entries[i], |