[PATCH] Refactor: Simplify boolean conditional return statements in llvm/lib/MC/MCParser
Richard
legalize at xmission.com
Mon May 25 08:35:52 PDT 2015
Update from comments, clang-format
http://reviews.llvm.org/D9977
Files:
lib/MC/MCParser/AsmParser.cpp
lib/MC/MCParser/ELFAsmParser.cpp
Index: lib/MC/MCParser/AsmParser.cpp
===================================================================
--- lib/MC/MCParser/AsmParser.cpp
+++ lib/MC/MCParser/AsmParser.cpp
@@ -3158,11 +3158,8 @@
return false;
const unsigned Application = Encoding & 0x70;
- if (Application != dwarf::DW_EH_PE_absptr &&
- Application != dwarf::DW_EH_PE_pcrel)
- return false;
-
- return true;
+ return Application == dwarf::DW_EH_PE_absptr ||
+ Application == dwarf::DW_EH_PE_pcrel;
}
/// parseDirectiveCFIPersonalityOrLsda
Index: lib/MC/MCParser/ELFAsmParser.cpp
===================================================================
--- lib/MC/MCParser/ELFAsmParser.cpp
+++ lib/MC/MCParser/ELFAsmParser.cpp
@@ -262,10 +262,7 @@
if (PrevLoc.getPointer() + CurSize != getTok().getLoc().getPointer())
break;
}
- if (Size == 0)
- return true;
-
- return false;
+ return Size == 0;
}
static unsigned parseSectionFlags(StringRef flagsStr, bool *UseLastGroup) {
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9977.26439.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150525/5b7dc8ed/attachment.bin>
More information about the llvm-commits
mailing list