[Lldb-commits] [PATCH] D40635: refactor: Simplify loop with DWARFCompileUnit::Extract

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 29 21:49:25 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL319402: refactor: Simplify loop with DWARFCompileUnit::Extract (authored by jankratochvil).

Changed prior to commit:
  https://reviews.llvm.org/D40635?vs=124871&id=124872#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40635

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -97,12 +97,8 @@
   if (m_compile_units.empty()) {
     if (m_dwarf2Data != NULL) {
       lldb::offset_t offset = 0;
-      for (;;) {
-        DWARFCompileUnitSP cu_sp =
-            DWARFCompileUnit::Extract(m_dwarf2Data, &offset);
-        if (cu_sp.get() == NULL)
-          break;
-
+      DWARFCompileUnitSP cu_sp;
+      while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, &offset))) {
         m_compile_units.push_back(cu_sp);
 
         offset = cu_sp->GetNextCompileUnitOffset();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40635.124872.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171130/5e067638/attachment.bin>


More information about the lldb-commits mailing list