diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-07-08 17:33:10 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-07-08 17:33:10 +0000 |
commit | ac569a656fb2ab25a65d74c98e2c70865ea0c507 (patch) | |
tree | 0eccd878056a89b725da851ef72f4b5cc6d89d09 /llvm/lib | |
parent | e785b1920217a20170e0978053183014d1159b87 (diff) | |
download | bcm5719-llvm-ac569a656fb2ab25a65d74c98e2c70865ea0c507.tar.gz bcm5719-llvm-ac569a656fb2ab25a65d74c98e2c70865ea0c507.zip |
DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.
No functionality change.
llvm-svn: 185842
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 401e67cf04e..6b06d8b99b3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2385,19 +2385,17 @@ void DwarfUnits::emitAddresses(const MCSection *AddrSection) { // Get all of the address pool entries and put them in an array by their ID so // we can sort them. - SmallVector<std::pair<unsigned, const MCExpr *>, 64> Entries; + SmallVector<const MCExpr *, 64> Entries(AddressPool.size()); for (DenseMap<const MCExpr *, unsigned>::iterator I = AddressPool.begin(), E = AddressPool.end(); I != E; ++I) - Entries.push_back(std::make_pair(I->second, I->first)); - - array_pod_sort(Entries.begin(), Entries.end()); + Entries[I->second] = I->first; for (unsigned i = 0, e = Entries.size(); i != e; ++i) { // Emit an expression for reference from debug information entries. - if (const MCExpr *Expr = Entries[i].second) + if (const MCExpr *Expr = Entries[i]) Asm->OutStreamer.EmitValue(Expr, Asm->getDataLayout().getPointerSize()); else Asm->OutStreamer.EmitIntValue(0, Asm->getDataLayout().getPointerSize()); |