[llvm] r204696 - DebugInfo: Remove unnecessary zero-size check

David Blaikie dblaikie at gmail.com
Mon Mar 24 18:43:57 PDT 2014


Author: dblaikie
Date: Mon Mar 24 20:43:56 2014
New Revision: 204696

URL: http://llvm.org/viewvc/llvm-project?rev=204696&view=rev
Log:
DebugInfo: Remove unnecessary zero-size check

This seems excessive - switching section isn't expensive (or if it is
we're already being wasteful, since we emitted the debug_loc section
symbol earlier anyway) and otherwise there's no work that happens in
this function when the list is empty.

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=204696&r1=204695&r2=204696&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Mar 24 20:43:56 2014
@@ -2377,9 +2377,6 @@ void DwarfDebug::emitDebugLocEntry(ByteS
 
 // Emit locations into the debug loc section.
 void DwarfDebug::emitDebugLoc() {
-  if (DotDebugLocEntries.empty())
-    return;
-
   // Start the dwarf loc section.
   Asm->OutStreamer.SwitchSection(
       Asm->getObjFileLowering().getDwarfLocSection());





More information about the llvm-commits mailing list