Skip to content

Commit

Permalink
Refactor: Simplify boolean conditional return statements in llvm/lib/…
Browse files Browse the repository at this point in the history
…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

llvm-svn: 238132
  • Loading branch information
d0k committed May 25, 2015
1 parent f145228 commit 68a2956
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
Expand Up @@ -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.
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,
Expand Down
5 changes: 1 addition & 4 deletions llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
Expand Up @@ -79,10 +79,7 @@ bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {
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) {
Expand Down

0 comments on commit 68a2956

Please sign in to comment.