[llvm] r232814 - Reduce indentation after return. NFC.
Rafael Espindola
rafael.espindola at gmail.com
Fri Mar 20 07:33:25 PDT 2015
Author: rafael
Date: Fri Mar 20 09:33:25 2015
New Revision: 232814
URL: http://llvm.org/viewvc/llvm-project?rev=232814&view=rev
Log:
Reduce indentation after return. NFC.
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp?rev=232814&r1=232813&r2=232814&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp Fri Mar 20 09:33:25 2015
@@ -81,7 +81,6 @@ unsigned X86ELFObjectWriter::GetRelocTyp
case MCSymbolRefExpr::VK_TLSLD:
return ELF::R_X86_64_TLSLD;
}
- break;
case FK_PCRel_2:
assert(Modifier == MCSymbolRefExpr::VK_None);
return ELF::R_X86_64_PC16;
@@ -89,151 +88,139 @@ unsigned X86ELFObjectWriter::GetRelocTyp
assert(Modifier == MCSymbolRefExpr::VK_None);
return ELF::R_X86_64_PC8;
}
- } else {
- switch ((unsigned)Fixup.getKind()) {
+ }
+ switch ((unsigned)Fixup.getKind()) {
+ default:
+ llvm_unreachable("invalid fixup kind!");
+ case X86::reloc_global_offset_table8:
+ return ELF::R_X86_64_GOTPC64;
+ case X86::reloc_global_offset_table:
+ return ELF::R_X86_64_GOTPC32;
+ case FK_Data_8:
+ switch (Modifier) {
default:
- llvm_unreachable("invalid fixup kind!");
- case X86::reloc_global_offset_table8:
- return ELF::R_X86_64_GOTPC64;
- case X86::reloc_global_offset_table:
- return ELF::R_X86_64_GOTPC32;
- case FK_Data_8:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_X86_64_64;
- case MCSymbolRefExpr::VK_GOT:
- return ELF::R_X86_64_GOT64;
- case MCSymbolRefExpr::VK_GOTOFF:
- return ELF::R_X86_64_GOTOFF64;
- case MCSymbolRefExpr::VK_TPOFF:
- return ELF::R_X86_64_TPOFF64;
- case MCSymbolRefExpr::VK_DTPOFF:
- return ELF::R_X86_64_DTPOFF64;
- case MCSymbolRefExpr::VK_SIZE:
- return ELF::R_X86_64_SIZE64;
- }
- break;
- case X86::reloc_signed_4byte:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_X86_64_32S;
- case MCSymbolRefExpr::VK_GOT:
- return ELF::R_X86_64_GOT32;
- case MCSymbolRefExpr::VK_GOTPCREL:
- return ELF::R_X86_64_GOTPCREL;
- case MCSymbolRefExpr::VK_TPOFF:
- return ELF::R_X86_64_TPOFF32;
- case MCSymbolRefExpr::VK_DTPOFF:
- return ELF::R_X86_64_DTPOFF32;
- case MCSymbolRefExpr::VK_SIZE:
- return ELF::R_X86_64_SIZE32;
- }
- break;
- case FK_Data_4:
- return ELF::R_X86_64_32;
- case FK_Data_2:
- return ELF::R_X86_64_16;
- case FK_PCRel_1:
- case FK_Data_1:
- return ELF::R_X86_64_8;
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_X86_64_64;
+ case MCSymbolRefExpr::VK_GOT:
+ return ELF::R_X86_64_GOT64;
+ case MCSymbolRefExpr::VK_GOTOFF:
+ return ELF::R_X86_64_GOTOFF64;
+ case MCSymbolRefExpr::VK_TPOFF:
+ return ELF::R_X86_64_TPOFF64;
+ case MCSymbolRefExpr::VK_DTPOFF:
+ return ELF::R_X86_64_DTPOFF64;
+ case MCSymbolRefExpr::VK_SIZE:
+ return ELF::R_X86_64_SIZE64;
}
- }
- } else {
- assert(getEMachine() == ELF::EM_386 && "Unsupported ELF machine type.");
- if (IsPCRel) {
- switch ((unsigned)Fixup.getKind()) {
+ case X86::reloc_signed_4byte:
+ switch (Modifier) {
default:
- llvm_unreachable("invalid fixup kind!");
-
- case X86::reloc_global_offset_table:
- return ELF::R_386_GOTPC;
- case FK_PCRel_1:
- case FK_Data_1:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_386_PC8;
- }
- break;
-
- case FK_PCRel_2:
- case FK_Data_2:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_386_PC16;
- }
- break;
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_X86_64_32S;
+ case MCSymbolRefExpr::VK_GOT:
+ return ELF::R_X86_64_GOT32;
+ case MCSymbolRefExpr::VK_GOTPCREL:
+ return ELF::R_X86_64_GOTPCREL;
+ case MCSymbolRefExpr::VK_TPOFF:
+ return ELF::R_X86_64_TPOFF32;
+ case MCSymbolRefExpr::VK_DTPOFF:
+ return ELF::R_X86_64_DTPOFF32;
+ case MCSymbolRefExpr::VK_SIZE:
+ return ELF::R_X86_64_SIZE32;
+ }
+ case FK_Data_4:
+ return ELF::R_X86_64_32;
+ case FK_Data_2:
+ return ELF::R_X86_64_16;
+ case FK_PCRel_1:
+ case FK_Data_1:
+ return ELF::R_X86_64_8;
+ }
+ }
+ assert(getEMachine() == ELF::EM_386 && "Unsupported ELF machine type.");
+ if (IsPCRel) {
+ switch ((unsigned)Fixup.getKind()) {
+ default:
+ llvm_unreachable("invalid fixup kind!");
- case X86::reloc_riprel_4byte:
- case X86::reloc_signed_4byte:
- case FK_PCRel_4:
- case FK_Data_4:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_386_PC32;
- case MCSymbolRefExpr::VK_PLT:
- return ELF::R_386_PLT32;
- }
- break;
+ case X86::reloc_global_offset_table:
+ return ELF::R_386_GOTPC;
+ case FK_PCRel_1:
+ case FK_Data_1:
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_386_PC8;
}
- } else {
- switch ((unsigned)Fixup.getKind()) {
+ case FK_PCRel_2:
+ case FK_Data_2:
+ switch (Modifier) {
default:
- llvm_unreachable("invalid fixup kind!");
-
- case X86::reloc_global_offset_table:
- return ELF::R_386_GOTPC;
- break;
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_386_PC16;
+ }
+ case X86::reloc_riprel_4byte:
+ case X86::reloc_signed_4byte:
+ case FK_PCRel_4:
+ case FK_Data_4:
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_386_PC32;
+ case MCSymbolRefExpr::VK_PLT:
+ return ELF::R_386_PLT32;
+ }
+ }
+ } else {
+ switch ((unsigned)Fixup.getKind()) {
+ default:
+ llvm_unreachable("invalid fixup kind!");
+ case X86::reloc_global_offset_table:
+ return ELF::R_386_GOTPC;
- // FIXME: Should we avoid selecting reloc_signed_4byte in 32 bit mode
- // instead?
- case X86::reloc_signed_4byte:
- case FK_PCRel_4:
- case FK_Data_4:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- return ELF::R_386_32;
- case MCSymbolRefExpr::VK_GOT:
- return ELF::R_386_GOT32;
- case MCSymbolRefExpr::VK_PLT:
- return ELF::R_386_PLT32;
- case MCSymbolRefExpr::VK_GOTOFF:
- return ELF::R_386_GOTOFF;
- case MCSymbolRefExpr::VK_TLSGD:
- return ELF::R_386_TLS_GD;
- case MCSymbolRefExpr::VK_TPOFF:
- return ELF::R_386_TLS_LE_32;
- case MCSymbolRefExpr::VK_INDNTPOFF:
- return ELF::R_386_TLS_IE;
- case MCSymbolRefExpr::VK_NTPOFF:
- return ELF::R_386_TLS_LE;
- case MCSymbolRefExpr::VK_GOTNTPOFF:
- return ELF::R_386_TLS_GOTIE;
- case MCSymbolRefExpr::VK_TLSLDM:
- return ELF::R_386_TLS_LDM;
- case MCSymbolRefExpr::VK_DTPOFF:
- return ELF::R_386_TLS_LDO_32;
- case MCSymbolRefExpr::VK_GOTTPOFF:
- return ELF::R_386_TLS_IE_32;
- }
- break;
- case FK_Data_2:
- return ELF::R_386_16;
- case FK_PCRel_1:
- case FK_Data_1:
- return ELF::R_386_8;
+ // FIXME: Should we avoid selecting reloc_signed_4byte in 32 bit mode
+ // instead?
+ case X86::reloc_signed_4byte:
+ case FK_PCRel_4:
+ case FK_Data_4:
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ return ELF::R_386_32;
+ case MCSymbolRefExpr::VK_GOT:
+ return ELF::R_386_GOT32;
+ case MCSymbolRefExpr::VK_PLT:
+ return ELF::R_386_PLT32;
+ case MCSymbolRefExpr::VK_GOTOFF:
+ return ELF::R_386_GOTOFF;
+ case MCSymbolRefExpr::VK_TLSGD:
+ return ELF::R_386_TLS_GD;
+ case MCSymbolRefExpr::VK_TPOFF:
+ return ELF::R_386_TLS_LE_32;
+ case MCSymbolRefExpr::VK_INDNTPOFF:
+ return ELF::R_386_TLS_IE;
+ case MCSymbolRefExpr::VK_NTPOFF:
+ return ELF::R_386_TLS_LE;
+ case MCSymbolRefExpr::VK_GOTNTPOFF:
+ return ELF::R_386_TLS_GOTIE;
+ case MCSymbolRefExpr::VK_TLSLDM:
+ return ELF::R_386_TLS_LDM;
+ case MCSymbolRefExpr::VK_DTPOFF:
+ return ELF::R_386_TLS_LDO_32;
+ case MCSymbolRefExpr::VK_GOTTPOFF:
+ return ELF::R_386_TLS_IE_32;
}
+ case FK_Data_2:
+ return ELF::R_386_16;
+ case FK_PCRel_1:
+ case FK_Data_1:
+ return ELF::R_386_8;
}
}
}
More information about the llvm-commits
mailing list