[llvm] r332419 - ARM: Deduplicate code and remove unnecessary declaration. NFCI.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue May 15 17:21:31 PDT 2018
Author: pcc
Date: Tue May 15 17:21:31 2018
New Revision: 332419
URL: http://llvm.org/viewvc/llvm-project?rev=332419&view=rev
Log:
ARM: Deduplicate code and remove unnecessary declaration. NFCI.
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=332419&r1=332418&r2=332419&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Tue May 15 17:21:31 2018
@@ -1153,11 +1153,11 @@ static MachO::CPUSubTypeARM getMachOSubT
}
}
-MCAsmBackend *llvm::createARMAsmBackend(const Target &T,
- const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options,
- bool isLittle) {
+static MCAsmBackend *createARMAsmBackend(const Target &T,
+ const MCSubtargetInfo &STI,
+ const MCRegisterInfo &MRI,
+ const MCTargetOptions &Options,
+ bool isLittle) {
const Triple &TheTriple = STI.getTargetTriple();
switch (TheTriple.getObjectFormat()) {
default:
@@ -1189,17 +1189,3 @@ MCAsmBackend *llvm::createARMBEAsmBacken
const MCTargetOptions &Options) {
return createARMAsmBackend(T, STI, MRI, Options, false);
}
-
-MCAsmBackend *llvm::createThumbLEAsmBackend(const Target &T,
- const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options) {
- return createARMAsmBackend(T, STI, MRI, Options, true);
-}
-
-MCAsmBackend *llvm::createThumbBEAsmBackend(const Target &T,
- const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options) {
- return createARMAsmBackend(T, STI, MRI, Options, false);
-}
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=332419&r1=332418&r2=332419&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Tue May 15 17:21:31 2018
@@ -342,19 +342,12 @@ extern "C" void LLVMInitializeARMTargetM
for (Target *T : {&getTheThumbLETarget(), &getTheThumbBETarget()})
TargetRegistry::RegisterMCInstrAnalysis(*T, createThumbMCInstrAnalysis);
- // Register the MC Code Emitter
- for (Target *T : {&getTheARMLETarget(), &getTheThumbLETarget()})
+ for (Target *T : {&getTheARMLETarget(), &getTheThumbLETarget()}) {
TargetRegistry::RegisterMCCodeEmitter(*T, createARMLEMCCodeEmitter);
- for (Target *T : {&getTheARMBETarget(), &getTheThumbBETarget()})
+ TargetRegistry::RegisterMCAsmBackend(*T, createARMLEAsmBackend);
+ }
+ for (Target *T : {&getTheARMBETarget(), &getTheThumbBETarget()}) {
TargetRegistry::RegisterMCCodeEmitter(*T, createARMBEMCCodeEmitter);
-
- // Register the asm backend.
- TargetRegistry::RegisterMCAsmBackend(getTheARMLETarget(),
- createARMLEAsmBackend);
- TargetRegistry::RegisterMCAsmBackend(getTheARMBETarget(),
- createARMBEAsmBackend);
- TargetRegistry::RegisterMCAsmBackend(getTheThumbLETarget(),
- createThumbLEAsmBackend);
- TargetRegistry::RegisterMCAsmBackend(getTheThumbBETarget(),
- createThumbBEAsmBackend);
+ TargetRegistry::RegisterMCAsmBackend(*T, createARMBEAsmBackend);
+ }
}
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h?rev=332419&r1=332418&r2=332419&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h Tue May 15 17:21:31 2018
@@ -68,11 +68,6 @@ MCCodeEmitter *createARMBEMCCodeEmitter(
const MCRegisterInfo &MRI,
MCContext &Ctx);
-MCAsmBackend *createARMAsmBackend(const Target &T, const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options,
- bool IsLittleEndian);
-
MCAsmBackend *createARMLEAsmBackend(const Target &T, const MCSubtargetInfo &STI,
const MCRegisterInfo &MRI,
const MCTargetOptions &Options);
@@ -81,16 +76,6 @@ MCAsmBackend *createARMBEAsmBackend(cons
const MCRegisterInfo &MRI,
const MCTargetOptions &Options);
-MCAsmBackend *createThumbLEAsmBackend(const Target &T,
- const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options);
-
-MCAsmBackend *createThumbBEAsmBackend(const Target &T,
- const MCSubtargetInfo &STI,
- const MCRegisterInfo &MRI,
- const MCTargetOptions &Options);
-
// Construct a PE/COFF machine code streamer which will generate a PE/COFF
// object file.
MCStreamer *createARMWinCOFFStreamer(MCContext &Context,
More information about the llvm-commits
mailing list