<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 4:15 PM, Rafael Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Wed Mar 18 18:15:49 2015<br>
New Revision: 232688<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232688&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232688&view=rev</a><br>
Log:<br>
two or more, use a for.<br></blockquote><div><br>Cute (both the comment, and the code) :)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp<br>
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp<br>
llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -136,79 +136,39 @@ static MCStreamer *createMCStreamer(cons<br>
<br>
// Force static initialization.<br>
extern "C" void LLVMInitializeAArch64TargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfoFn X(TheAArch64leTarget, createAArch64MCAsmInfo);<br>
- RegisterMCAsmInfoFn Y(TheAArch64beTarget, createAArch64MCAsmInfo);<br>
- RegisterMCAsmInfoFn Z(TheARM64Target, createAArch64MCAsmInfo);<br>
-<br>
- // Register the MC codegen info.<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheAArch64leTarget,<br>
- createAArch64MCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheAArch64beTarget,<br>
- createAArch64MCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheARM64Target,<br>
- createAArch64MCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheAArch64leTarget,<br>
- createAArch64MCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheAArch64beTarget,<br>
- createAArch64MCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheARM64Target,<br>
- createAArch64MCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheAArch64leTarget,<br>
- createAArch64MCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheAArch64beTarget,<br>
- createAArch64MCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheARM64Target,<br>
- createAArch64MCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheAArch64leTarget,<br>
- createAArch64MCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheAArch64beTarget,<br>
- createAArch64MCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheARM64Target,<br>
- createAArch64MCSubtargetInfo);<br>
+ for (Target *T :<br>
+ {&TheAArch64leTarget, &TheAArch64beTarget, &TheARM64Target}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfoFn X(*T, createAArch64MCAsmInfo);<br>
+<br>
+ // Register the MC codegen info.<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createAArch64MCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createAArch64MCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createAArch64MCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createAArch64MCSubtargetInfo);<br>
+<br>
+ // Register the MC Code Emitter<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createAArch64MCCodeEmitter);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the asm streamer.<br>
+ TargetRegistry::RegisterAsmTargetStreamer(*T,<br>
+ createAArch64AsmTargetStreamer);<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createAArch64MCInstPrinter);<br>
+ }<br>
<br>
// Register the asm backend.<br>
- TargetRegistry::RegisterMCAsmBackend(TheAArch64leTarget,<br>
- createAArch64leAsmBackend);<br>
+ for (Target *T : {&TheAArch64leTarget, &TheARM64Target})<br>
+ TargetRegistry::RegisterMCAsmBackend(*T, createAArch64leAsmBackend);<br>
TargetRegistry::RegisterMCAsmBackend(TheAArch64beTarget,<br>
createAArch64beAsmBackend);<br>
- TargetRegistry::RegisterMCAsmBackend(TheARM64Target,<br>
- createAArch64leAsmBackend);<br>
-<br>
- // Register the MC Code Emitter<br>
- TargetRegistry::RegisterMCCodeEmitter(TheAArch64leTarget,<br>
- createAArch64MCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheAArch64beTarget,<br>
- createAArch64MCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheARM64Target,<br>
- createAArch64MCCodeEmitter);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(TheAArch64leTarget,<br>
- createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheAArch64beTarget,<br>
- createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheARM64Target, createMCStreamer);<br>
-<br>
- // Register the asm streamer.<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheAArch64leTarget,<br>
- createAArch64AsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheAArch64beTarget,<br>
- createAArch64AsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheARM64Target,<br>
- createAArch64AsmTargetStreamer);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(TheAArch64leTarget,<br>
- createAArch64MCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheAArch64beTarget,<br>
- createAArch64MCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheARM64Target,<br>
- createAArch64MCInstPrinter);<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -380,61 +380,48 @@ static MCInstrAnalysis *createARMMCInstr<br>
<br>
// Force static initialization.<br>
extern "C" void LLVMInitializeARMTargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfoFn X(TheARMLETarget, createARMMCAsmInfo);<br>
- RegisterMCAsmInfoFn Y(TheARMBETarget, createARMMCAsmInfo);<br>
- RegisterMCAsmInfoFn A(TheThumbLETarget, createARMMCAsmInfo);<br>
- RegisterMCAsmInfoFn B(TheThumbBETarget, createARMMCAsmInfo);<br>
-<br>
- // Register the MC codegen info.<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheARMLETarget, createARMMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheARMBETarget, createARMMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheThumbLETarget,<br>
- createARMMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheThumbBETarget,<br>
- createARMMCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheARMLETarget, createARMMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheARMBETarget, createARMMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheThumbLETarget, createARMMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheThumbBETarget, createARMMCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheARMLETarget, createARMMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheARMBETarget, createARMMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheThumbLETarget, createARMMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheThumbBETarget, createARMMCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheARMLETarget,<br>
- ARM_MC::createARMMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheARMBETarget,<br>
- ARM_MC::createARMMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheThumbLETarget,<br>
- ARM_MC::createARMMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheThumbBETarget,<br>
- ARM_MC::createARMMCSubtargetInfo);<br>
-<br>
- // Register the MC instruction analyzer.<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheARMLETarget,<br>
- createARMMCInstrAnalysis);<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheARMBETarget,<br>
- createARMMCInstrAnalysis);<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheThumbLETarget,<br>
- createARMMCInstrAnalysis);<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheThumbBETarget,<br>
- createARMMCInstrAnalysis);<br>
+ for (Target *T : {&TheARMLETarget, &TheARMBETarget, &TheThumbLETarget,<br>
+ &TheThumbBETarget}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfoFn X(*T, createARMMCAsmInfo);<br>
+<br>
+ // Register the MC codegen info.<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createARMMCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createARMMCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createARMMCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T,<br>
+ ARM_MC::createARMMCSubtargetInfo);<br>
+<br>
+ // Register the MC instruction analyzer.<br>
+ TargetRegistry::RegisterMCInstrAnalysis(*T, createARMMCInstrAnalysis);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the asm streamer.<br>
+ TargetRegistry::RegisterAsmTargetStreamer(*T, createARMTargetAsmStreamer);<br>
+<br>
+ // Register the null TargetStreamer.<br>
+ TargetRegistry::RegisterNullTargetStreamer(*T, createARMNullTargetStreamer);<br>
+<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createARMMCInstPrinter);<br>
+<br>
+ // Register the MC relocation info.<br>
+ TargetRegistry::RegisterMCRelocationInfo(*T, createARMMCRelocationInfo);<br>
+ }<br>
<br>
// Register the MC Code Emitter<br>
- TargetRegistry::RegisterMCCodeEmitter(TheARMLETarget,<br>
- createARMLEMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheARMBETarget,<br>
- createARMBEMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheThumbLETarget,<br>
- createARMLEMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheThumbBETarget,<br>
- createARMBEMCCodeEmitter);<br>
+ for (Target *T : {&TheARMLETarget, &TheThumbLETarget})<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createARMLEMCCodeEmitter);<br>
+ for (Target *T : {&TheARMBETarget, &TheThumbBETarget})<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createARMBEMCCodeEmitter);<br>
<br>
// Register the asm backend.<br>
TargetRegistry::RegisterMCAsmBackend(TheARMLETarget, createARMLEAsmBackend);<br>
@@ -443,48 +430,4 @@ extern "C" void LLVMInitializeARMTargetM<br>
createThumbLEAsmBackend);<br>
TargetRegistry::RegisterMCAsmBackend(TheThumbBETarget,<br>
createThumbBEAsmBackend);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(TheARMLETarget, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheARMBETarget, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheThumbLETarget, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheThumbBETarget, createMCStreamer);<br>
-<br>
- // Register the asm streamer.<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheARMLETarget,<br>
- createARMTargetAsmStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheARMBETarget,<br>
- createARMTargetAsmStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheThumbLETarget,<br>
- createARMTargetAsmStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheThumbBETarget,<br>
- createARMTargetAsmStreamer);<br>
-<br>
- // Register the null TargetStreamer.<br>
- TargetRegistry::RegisterNullTargetStreamer(TheARMLETarget,<br>
- createARMNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheARMBETarget,<br>
- createARMNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheThumbLETarget,<br>
- createARMNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheThumbBETarget,<br>
- createARMNullTargetStreamer);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(TheARMLETarget, createARMMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheARMBETarget, createARMMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheThumbLETarget,<br>
- createARMMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheThumbBETarget,<br>
- createARMMCInstPrinter);<br>
-<br>
- // Register the MC relocation info.<br>
- TargetRegistry::RegisterMCRelocationInfo(TheARMLETarget,<br>
- createARMMCRelocationInfo);<br>
- TargetRegistry::RegisterMCRelocationInfo(TheARMBETarget,<br>
- createARMMCRelocationInfo);<br>
- TargetRegistry::RegisterMCRelocationInfo(TheThumbLETarget,<br>
- createARMMCRelocationInfo);<br>
- TargetRegistry::RegisterMCRelocationInfo(TheThumbBETarget,<br>
- createARMMCRelocationInfo);<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -131,71 +131,42 @@ static MCTargetStreamer *createMipsNullT<br>
}<br>
<br>
extern "C" void LLVMInitializeMipsTargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfoFn X(TheMipsTarget, createMipsMCAsmInfo);<br>
- RegisterMCAsmInfoFn Y(TheMipselTarget, createMipsMCAsmInfo);<br>
- RegisterMCAsmInfoFn A(TheMips64Target, createMipsMCAsmInfo);<br>
- RegisterMCAsmInfoFn B(TheMips64elTarget, createMipsMCAsmInfo);<br>
-<br>
- // Register the MC codegen info.<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheMipsTarget,<br>
- createMipsMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheMipselTarget,<br>
- createMipsMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheMips64Target,<br>
- createMipsMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheMips64elTarget,<br>
- createMipsMCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheMipsTarget, createMipsMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheMipselTarget, createMipsMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheMips64Target, createMipsMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheMips64elTarget,<br>
- createMipsMCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheMipsTarget, createMipsMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheMipselTarget, createMipsMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheMips64Target, createMipsMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheMips64elTarget,<br>
- createMipsMCRegisterInfo);<br>
+ for (Target *T : {&TheMipsTarget, &TheMipselTarget, &TheMips64Target,<br>
+ &TheMips64elTarget}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfoFn X(*T, createMipsMCAsmInfo);<br>
+<br>
+ // Register the MC codegen info.<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createMipsMCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createMipsMCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createMipsMCRegisterInfo);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the asm target streamer.<br>
+ TargetRegistry::RegisterAsmTargetStreamer(*T, createMipsAsmTargetStreamer);<br>
+<br>
+ TargetRegistry::RegisterNullTargetStreamer(*T,<br>
+ createMipsNullTargetStreamer);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createMipsMCSubtargetInfo);<br>
+<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createMipsMCInstPrinter);<br>
+ }<br>
<br>
// Register the MC Code Emitter<br>
- TargetRegistry::RegisterMCCodeEmitter(TheMipsTarget,<br>
- createMipsMCCodeEmitterEB);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheMipselTarget,<br>
- createMipsMCCodeEmitterEL);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheMips64Target,<br>
- createMipsMCCodeEmitterEB);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheMips64elTarget,<br>
- createMipsMCCodeEmitterEL);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(TheMipsTarget, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheMipselTarget, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheMips64Target, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheMips64elTarget,<br>
- createMCStreamer);<br>
-<br>
- // Register the asm streamer.<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheMipsTarget,<br>
- createMipsAsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheMipselTarget,<br>
- createMipsAsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheMips64Target,<br>
- createMipsAsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheMips64elTarget,<br>
- createMipsAsmTargetStreamer);<br>
-<br>
- TargetRegistry::RegisterNullTargetStreamer(TheMipsTarget,<br>
- createMipsNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheMipselTarget,<br>
- createMipsNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheMips64Target,<br>
- createMipsNullTargetStreamer);<br>
- TargetRegistry::RegisterNullTargetStreamer(TheMips64elTarget,<br>
- createMipsNullTargetStreamer);<br>
+ for (Target *T : {&TheMipsTarget, &TheMips64Target})<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createMipsMCCodeEmitterEB);<br>
+<br>
+ for (Target *T : {&TheMipselTarget, &TheMips64elTarget})<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createMipsMCCodeEmitterEL);<br>
<br>
// Register the asm backend.<br>
TargetRegistry::RegisterMCAsmBackend(TheMipsTarget,<br>
@@ -207,23 +178,4 @@ extern "C" void LLVMInitializeMipsTarget<br>
TargetRegistry::RegisterMCAsmBackend(TheMips64elTarget,<br>
createMipsAsmBackendEL64);<br>
<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheMipsTarget,<br>
- createMipsMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheMipselTarget,<br>
- createMipsMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheMips64Target,<br>
- createMipsMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheMips64elTarget,<br>
- createMipsMCSubtargetInfo);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(TheMipsTarget,<br>
- createMipsMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheMipselTarget,<br>
- createMipsMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheMips64Target,<br>
- createMipsMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheMips64elTarget,<br>
- createMipsMCInstPrinter);<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -71,35 +71,23 @@ static MCInstPrinter *createNVPTXMCInstP<br>
<br>
// Force static initialization.<br>
extern "C" void LLVMInitializeNVPTXTargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfo<NVPTXMCAsmInfo> X(TheNVPTXTarget32);<br>
- RegisterMCAsmInfo<NVPTXMCAsmInfo> Y(TheNVPTXTarget64);<br>
-<br>
- // Register the MC codegen info.<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheNVPTXTarget32,<br>
- createNVPTXMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheNVPTXTarget64,<br>
- createNVPTXMCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheNVPTXTarget32, createNVPTXMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheNVPTXTarget64, createNVPTXMCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheNVPTXTarget32,<br>
- createNVPTXMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheNVPTXTarget64,<br>
- createNVPTXMCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheNVPTXTarget32,<br>
- createNVPTXMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheNVPTXTarget64,<br>
- createNVPTXMCSubtargetInfo);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(TheNVPTXTarget32,<br>
- createNVPTXMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheNVPTXTarget64,<br>
- createNVPTXMCInstPrinter);<br>
+ for (Target *T : {&TheNVPTXTarget32, &TheNVPTXTarget64}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfo<NVPTXMCAsmInfo> X(*T);<br>
+<br>
+ // Register the MC codegen info.<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createNVPTXMCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createNVPTXMCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createNVPTXMCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createNVPTXMCSubtargetInfo);<br>
+<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createNVPTXMCInstPrinter);<br>
+ }<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -257,63 +257,35 @@ static MCInstPrinter *createPPCMCInstPri<br>
}<br>
<br>
extern "C" void LLVMInitializePowerPCTargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfoFn C(ThePPC32Target, createPPCMCAsmInfo);<br>
- RegisterMCAsmInfoFn D(ThePPC64Target, createPPCMCAsmInfo);<br>
- RegisterMCAsmInfoFn E(ThePPC64LETarget, createPPCMCAsmInfo);<br>
-<br>
- // Register the MC codegen info.<br>
- TargetRegistry::RegisterMCCodeGenInfo(ThePPC32Target, createPPCMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(ThePPC64Target, createPPCMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(ThePPC64LETarget,<br>
- createPPCMCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(ThePPC32Target, createPPCMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(ThePPC64Target, createPPCMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(ThePPC64LETarget,<br>
- createPPCMCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(ThePPC32Target, createPPCMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(ThePPC64Target, createPPCMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(ThePPC64LETarget, createPPCMCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(ThePPC32Target,<br>
- createPPCMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(ThePPC64Target,<br>
- createPPCMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(ThePPC64LETarget,<br>
- createPPCMCSubtargetInfo);<br>
-<br>
- // Register the MC Code Emitter<br>
- TargetRegistry::RegisterMCCodeEmitter(ThePPC32Target, createPPCMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(ThePPC64Target, createPPCMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(ThePPC64LETarget,<br>
- createPPCMCCodeEmitter);<br>
-<br>
+ for (Target *T : {&ThePPC32Target, &ThePPC64Target, &ThePPC64LETarget}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfoFn C(*T, createPPCMCAsmInfo);<br>
+<br>
+ // Register the MC codegen info.<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createPPCMCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createPPCMCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createPPCMCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createPPCMCSubtargetInfo);<br>
+<br>
+ // Register the MC Code Emitter<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createPPCMCCodeEmitter);<br>
+<br>
// Register the asm backend.<br>
- TargetRegistry::RegisterMCAsmBackend(ThePPC32Target, createPPCAsmBackend);<br>
- TargetRegistry::RegisterMCAsmBackend(ThePPC64Target, createPPCAsmBackend);<br>
- TargetRegistry::RegisterMCAsmBackend(ThePPC64LETarget, createPPCAsmBackend);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(ThePPC32Target, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(ThePPC64Target, createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(ThePPC64LETarget, createMCStreamer);<br>
-<br>
- // Register the asm streamer.<br>
- TargetRegistry::RegisterAsmTargetStreamer(ThePPC32Target,<br>
- createAsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(ThePPC64Target,<br>
- createAsmTargetStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(ThePPC64LETarget,<br>
- createAsmTargetStreamer);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(ThePPC32Target, createPPCMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(ThePPC64Target, createPPCMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(ThePPC64LETarget,<br>
- createPPCMCInstPrinter);<br>
+ TargetRegistry::RegisterMCAsmBackend(*T, createPPCAsmBackend);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the asm target streamer.<br>
+ TargetRegistry::RegisterAsmTargetStreamer(*T, createAsmTargetStreamer);<br>
+<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createPPCMCInstPrinter);<br>
+ }<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -74,28 +74,18 @@ static MCInstPrinter *createAMDGPUMCInst<br>
}<br>
<br>
extern "C" void LLVMInitializeR600TargetMC() {<br>
+ for (Target *T : {&TheAMDGPUTarget, &TheGCNTarget}) {<br>
+ RegisterMCAsmInfo<AMDGPUMCAsmInfo> X(*T);<br>
<br>
- RegisterMCAsmInfo<AMDGPUMCAsmInfo> Y(TheAMDGPUTarget);<br>
- RegisterMCAsmInfo<AMDGPUMCAsmInfo> Z(TheGCNTarget);<br>
+ TargetRegistry::RegisterMCCodeGenInfo(*T, createAMDGPUMCCodeGenInfo);<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createAMDGPUMCInstrInfo);<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createAMDGPUMCRegisterInfo);<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createAMDGPUMCSubtargetInfo);<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createAMDGPUMCInstPrinter);<br>
+ TargetRegistry::RegisterMCAsmBackend(*T, createAMDGPUAsmBackend);<br>
+ }<br>
<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheAMDGPUTarget, createAMDGPUMCCodeGenInfo);<br>
- TargetRegistry::RegisterMCCodeGenInfo(TheGCNTarget, createAMDGPUMCCodeGenInfo);<br>
-<br>
- TargetRegistry::RegisterMCInstrInfo(TheAMDGPUTarget, createAMDGPUMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheGCNTarget, createAMDGPUMCInstrInfo);<br>
-<br>
- TargetRegistry::RegisterMCRegInfo(TheAMDGPUTarget, createAMDGPUMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheGCNTarget, createAMDGPUMCRegisterInfo);<br>
-<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheAMDGPUTarget, createAMDGPUMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheGCNTarget, createAMDGPUMCSubtargetInfo);<br>
-<br>
- TargetRegistry::RegisterMCInstPrinter(TheAMDGPUTarget, createAMDGPUMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheGCNTarget, createAMDGPUMCInstPrinter);<br>
-<br>
- TargetRegistry::RegisterMCCodeEmitter(TheAMDGPUTarget, createR600MCCodeEmitter);<br>
+ TargetRegistry::RegisterMCCodeEmitter(TheAMDGPUTarget,<br>
+ createR600MCCodeEmitter);<br>
TargetRegistry::RegisterMCCodeEmitter(TheGCNTarget, createSIMCCodeEmitter);<br>
-<br>
- TargetRegistry::RegisterMCAsmBackend(TheAMDGPUTarget, createAMDGPUAsmBackend);<br>
- TargetRegistry::RegisterMCAsmBackend(TheGCNTarget, createAMDGPUAsmBackend);<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -152,54 +152,36 @@ extern "C" void LLVMInitializeSparcTarge<br>
RegisterMCAsmInfoFn X(TheSparcTarget, createSparcMCAsmInfo);<br>
RegisterMCAsmInfoFn Y(TheSparcV9Target, createSparcV9MCAsmInfo);<br>
<br>
+ for (Target *T : {&TheSparcTarget, &TheSparcV9Target}) {<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createSparcMCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createSparcMCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T, createSparcMCSubtargetInfo);<br>
+<br>
+ // Register the MC Code Emitter.<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createSparcMCCodeEmitter);<br>
+<br>
+ // Register the asm backend.<br>
+ TargetRegistry::RegisterMCAsmBackend(*T, createSparcAsmBackend);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the asm streamer.<br>
+ TargetRegistry::RegisterAsmTargetStreamer(*T, createTargetAsmStreamer);<br>
+<br>
+ // Register the MCInstPrinter<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createSparcMCInstPrinter);<br>
+ }<br>
+<br>
// Register the MC codegen info.<br>
TargetRegistry::RegisterMCCodeGenInfo(TheSparcTarget,<br>
createSparcMCCodeGenInfo);<br>
TargetRegistry::RegisterMCCodeGenInfo(TheSparcV9Target,<br>
createSparcV9MCCodeGenInfo);<br>
<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheSparcTarget, createSparcMCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheSparcV9Target, createSparcMCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheSparcTarget, createSparcMCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheSparcV9Target,<br>
- createSparcMCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheSparcTarget,<br>
- createSparcMCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheSparcV9Target,<br>
- createSparcMCSubtargetInfo);<br>
-<br>
- // Register the MC Code Emitter.<br>
- TargetRegistry::RegisterMCCodeEmitter(TheSparcTarget,<br>
- createSparcMCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheSparcV9Target,<br>
- createSparcMCCodeEmitter);<br>
-<br>
- //Register the asm backend.<br>
- TargetRegistry::RegisterMCAsmBackend(TheSparcTarget,<br>
- createSparcAsmBackend);<br>
- TargetRegistry::RegisterMCAsmBackend(TheSparcV9Target,<br>
- createSparcAsmBackend);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(TheSparcTarget,<br>
- createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheSparcV9Target,<br>
- createMCStreamer);<br>
-<br>
- // Register the asm streamer.<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheSparcTarget,<br>
- createTargetAsmStreamer);<br>
- TargetRegistry::RegisterAsmTargetStreamer(TheSparcV9Target,<br>
- createTargetAsmStreamer);<br>
-<br>
- // Register the MCInstPrinter<br>
- TargetRegistry::RegisterMCInstPrinter(TheSparcTarget,<br>
- createSparcMCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheSparcV9Target,<br>
- createSparcMCInstPrinter);<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp?rev=232688&r1=232687&r2=232688&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp Wed Mar 18 18:15:49 2015<br>
@@ -390,61 +390,42 @@ static MCInstrAnalysis *createX86MCInstr<br>
<br>
// Force static initialization.<br>
extern "C" void LLVMInitializeX86TargetMC() {<br>
- // Register the MC asm info.<br>
- RegisterMCAsmInfoFn A(TheX86_32Target, createX86MCAsmInfo);<br>
- RegisterMCAsmInfoFn B(TheX86_64Target, createX86MCAsmInfo);<br>
-<br>
- // Register the MC codegen info.<br>
- RegisterMCCodeGenInfoFn C(TheX86_32Target, createX86MCCodeGenInfo);<br>
- RegisterMCCodeGenInfoFn D(TheX86_64Target, createX86MCCodeGenInfo);<br>
-<br>
- // Register the MC instruction info.<br>
- TargetRegistry::RegisterMCInstrInfo(TheX86_32Target, createX86MCInstrInfo);<br>
- TargetRegistry::RegisterMCInstrInfo(TheX86_64Target, createX86MCInstrInfo);<br>
-<br>
- // Register the MC register info.<br>
- TargetRegistry::RegisterMCRegInfo(TheX86_32Target, createX86MCRegisterInfo);<br>
- TargetRegistry::RegisterMCRegInfo(TheX86_64Target, createX86MCRegisterInfo);<br>
-<br>
- // Register the MC subtarget info.<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheX86_32Target,<br>
- X86_MC::createX86MCSubtargetInfo);<br>
- TargetRegistry::RegisterMCSubtargetInfo(TheX86_64Target,<br>
- X86_MC::createX86MCSubtargetInfo);<br>
-<br>
- // Register the MC instruction analyzer.<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheX86_32Target,<br>
- createX86MCInstrAnalysis);<br>
- TargetRegistry::RegisterMCInstrAnalysis(TheX86_64Target,<br>
- createX86MCInstrAnalysis);<br>
-<br>
- // Register the code emitter.<br>
- TargetRegistry::RegisterMCCodeEmitter(TheX86_32Target,<br>
- createX86MCCodeEmitter);<br>
- TargetRegistry::RegisterMCCodeEmitter(TheX86_64Target,<br>
- createX86MCCodeEmitter);<br>
+ for (Target *T : {&TheX86_32Target, &TheX86_64Target}) {<br>
+ // Register the MC asm info.<br>
+ RegisterMCAsmInfoFn X(*T, createX86MCAsmInfo);<br>
+<br>
+ // Register the MC codegen info.<br>
+ RegisterMCCodeGenInfoFn Y(*T, createX86MCCodeGenInfo);<br>
+<br>
+ // Register the MC instruction info.<br>
+ TargetRegistry::RegisterMCInstrInfo(*T, createX86MCInstrInfo);<br>
+<br>
+ // Register the MC register info.<br>
+ TargetRegistry::RegisterMCRegInfo(*T, createX86MCRegisterInfo);<br>
+<br>
+ // Register the MC subtarget info.<br>
+ TargetRegistry::RegisterMCSubtargetInfo(*T,<br>
+ X86_MC::createX86MCSubtargetInfo);<br>
+<br>
+ // Register the MC instruction analyzer.<br>
+ TargetRegistry::RegisterMCInstrAnalysis(*T, createX86MCInstrAnalysis);<br>
+<br>
+ // Register the code emitter.<br>
+ TargetRegistry::RegisterMCCodeEmitter(*T, createX86MCCodeEmitter);<br>
+<br>
+ // Register the object streamer.<br>
+ TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);<br>
+<br>
+ // Register the MCInstPrinter.<br>
+ TargetRegistry::RegisterMCInstPrinter(*T, createX86MCInstPrinter);<br>
+<br>
+ // Register the MC relocation info.<br>
+ TargetRegistry::RegisterMCRelocationInfo(*T, createX86MCRelocationInfo);<br>
+ }<br>
<br>
// Register the asm backend.<br>
TargetRegistry::RegisterMCAsmBackend(TheX86_32Target,<br>
createX86_32AsmBackend);<br>
TargetRegistry::RegisterMCAsmBackend(TheX86_64Target,<br>
createX86_64AsmBackend);<br>
-<br>
- // Register the object streamer.<br>
- TargetRegistry::RegisterMCObjectStreamer(TheX86_32Target,<br>
- createMCStreamer);<br>
- TargetRegistry::RegisterMCObjectStreamer(TheX86_64Target,<br>
- createMCStreamer);<br>
-<br>
- // Register the MCInstPrinter.<br>
- TargetRegistry::RegisterMCInstPrinter(TheX86_32Target,<br>
- createX86MCInstPrinter);<br>
- TargetRegistry::RegisterMCInstPrinter(TheX86_64Target,<br>
- createX86MCInstPrinter);<br>
-<br>
- // Register the MC relocation info.<br>
- TargetRegistry::RegisterMCRelocationInfo(TheX86_32Target,<br>
- createX86MCRelocationInfo);<br>
- TargetRegistry::RegisterMCRelocationInfo(TheX86_64Target,<br>
- createX86MCRelocationInfo);<br>
}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>