Refactor: Simplify boolean conditional return statements in llvm/lib/DebugInfo/DWARF
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 25 May 2015 13:28:03 +0000 (13:28 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 25 May 2015 13:28:03 +0000 (13:28 +0000)
Use clang-tidy to simplify boolean conditional return statements. Patch by
Richard Thomson <legalize@xmission.com>!

Differential Revision: http://reviews.llvm.org/D9972

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238132 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFFormValue.cpp
lib/DebugInfo/DWARF/DWARFUnit.cpp

index 75ca7622139db256437adf2d2d8f505d8856e376..53a676efaf3f78a34e6067a3705ddc67ca8d6498 100644 (file)
@@ -127,10 +127,8 @@ bool DWARFFormValue::isFormClass(DWARFFormValue::FormClass FC) const {
   // 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.
   // 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,
 }
 
 bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
index 63a9985555140a132abf16c22fd8b5282292aaef..348476d72b603a01971850fb2cc90e6685ab2f40 100644 (file)
@@ -79,10 +79,7 @@ bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
     return false;
 
   Abbrevs = Abbrev->getAbbreviationDeclarationSet(AbbrOffset);
     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) {
 }
 
 bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) {