[llvm] r207748 - [llvm-readobj] Transform 'switch' with the only 'case' statement
Simon Atanasyan
simon at atanasyan.com
Thu May 1 04:57:40 PDT 2014
Author: atanasyan
Date: Thu May 1 06:57:40 2014
New Revision: 207748
URL: http://llvm.org/viewvc/llvm-project?rev=207748&view=rev
Log:
[llvm-readobj] Transform 'switch' with the only 'case' statement
to 'if' statement.
No functional changes,
Modified:
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=207748&r1=207747&r2=207748&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Thu May 1 06:57:40 2014
@@ -485,14 +485,11 @@ void ELFDumper<ELFT>::printFileHeaders()
W.printHex ("Entry", Header->e_entry);
W.printHex ("ProgramHeaderOffset", Header->e_phoff);
W.printHex ("SectionHeaderOffset", Header->e_shoff);
- switch (Header->e_machine) {
- case EM_MIPS:
+ if (Header->e_machine == EM_MIPS)
W.printFlags("Flags", Header->e_flags, makeArrayRef(ElfHeaderMipsFlags),
unsigned(ELF::EF_MIPS_ARCH));
- break;
- default:
+ else
W.printFlags("Flags", Header->e_flags);
- }
W.printNumber("HeaderSize", Header->e_ehsize);
W.printNumber("ProgramHeaderEntrySize", Header->e_phentsize);
W.printNumber("ProgramHeaderCount", Header->e_phnum);
More information about the llvm-commits
mailing list