[llvm] r185190 - DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'

David Blaikie dblaikie at gmail.com
Fri Jun 28 11:55:14 PDT 2013


Author: dblaikie
Date: Fri Jun 28 13:55:13 2013
New Revision: 185190

URL: http://llvm.org/viewvc/llvm-project?rev=185190&view=rev
Log:
DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185190&r1=185189&r2=185190&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jun 28 13:55:13 2013
@@ -250,7 +250,8 @@ unsigned DwarfUnits::getStringPoolIndex(
 unsigned DwarfUnits::getAddrPoolIndex(const MCSymbol *Sym) {
   std::pair<DenseMap<const MCSymbol *, unsigned>::iterator, bool> P =
       AddressPool.insert(std::make_pair(Sym, NextAddrPoolNumber));
-  NextAddrPoolNumber += P.second;
+  if (P.second)
+    ++NextAddrPoolNumber;
   return P.first->second;
 }
 





More information about the llvm-commits mailing list