Remove duplicated code and consolidate initializers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-04-09 19:20:37 +00:00
parent 7e0993d377
commit a9fa357be4
2 changed files with 5 additions and 15 deletions

View File

@ -222,20 +222,6 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return;
}
static MCInstPrinter *createHexagonMCInstPrinter(const Triple &T,
unsigned SyntaxVariant,
const MCAsmInfo &MAI,
const MCInstrInfo &MII,
const MCRegisterInfo &MRI) {
if (SyntaxVariant == 0)
return(new HexagonInstPrinter(MAI, MII, MRI));
else
return nullptr;
}
extern "C" void LLVMInitializeHexagonAsmPrinter() {
RegisterAsmPrinter<HexagonAsmPrinter> X(TheHexagonTarget);
TargetRegistry::RegisterMCInstPrinter(TheHexagonTarget,
createHexagonMCInstPrinter);
}

View File

@ -75,12 +75,16 @@ static MCCodeGenInfo *createHexagonMCCodeGenInfo(StringRef TT, Reloc::Model RM,
X->InitMCCodeGenInfo(Reloc::Static, CM, OL);
return X;
}
static MCInstPrinter *createHexagonMCInstPrinter(const Triple &T,
unsigned SyntaxVariant,
const MCAsmInfo &MAI,
const MCInstrInfo &MII,
const MCRegisterInfo &MRI) {
return new HexagonInstPrinter(MAI, MII, MRI);
if (SyntaxVariant == 0)
return(new HexagonInstPrinter(MAI, MII, MRI));
else
return nullptr;
}
// Force static initialization.