[PATCH] Refactor: Simplify boolean conditional return statements in llvm/lib/DebugInfo/DWARF

Phabricator reviews at reviews.llvm.org
Mon May 25 06:31:56 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9972

Files:
  llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
  llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp

Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -127,10 +127,8 @@
   // In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section offset.
   // Don't check for DWARF version here, as some producers may still do this
   // by mistake.
-  if ((Form == DW_FORM_data4 || Form == DW_FORM_data8) &&
-      FC == FC_SectionOffset)
-    return true;
-  return false;
+  return (Form == DW_FORM_data4 || Form == DW_FORM_data8) &&
+         FC == FC_SectionOffset;
 }
 
 bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -79,10 +79,7 @@
     return false;
 
   Abbrevs = Abbrev->getAbbreviationDeclarationSet(AbbrOffset);
-  if (Abbrevs == nullptr)
-    return false;
-
-  return true;
+  return Abbrevs != nullptr;
 }
 
 bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) {

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9972.26429.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150525/d521e0b9/attachment.bin>


More information about the llvm-commits mailing list