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

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
This commit is contained in:
Benjamin Kramer 2015-05-25 13:28:03 +00:00
parent 8ffbb68a86
commit 675da70da5
2 changed files with 3 additions and 8 deletions

View 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. // 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 // Don't check for DWARF version here, as some producers may still do this
// by mistake. // by mistake.
if ((Form == DW_FORM_data4 || Form == DW_FORM_data8) && return (Form == DW_FORM_data4 || Form == DW_FORM_data8) &&
FC == FC_SectionOffset) FC == FC_SectionOffset;
return true;
return false;
} }
bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,

View File

@ -79,10 +79,7 @@ bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
return false; return false;
Abbrevs = Abbrev->getAbbreviationDeclarationSet(AbbrOffset); Abbrevs = Abbrev->getAbbreviationDeclarationSet(AbbrOffset);
if (Abbrevs == nullptr) return Abbrevs != nullptr;
return false;
return true;
} }
bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) { bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) {