mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Separate MCInstPrinter registration from AsmPrinter registration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135974 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "MSP430MCTargetDesc.h"
|
||||
#include "MSP430MCAsmInfo.h"
|
||||
#include "InstPrinter/MSP430InstPrinter.h"
|
||||
#include "llvm/MC/MCInstrInfo.h"
|
||||
#include "llvm/MC/MCRegisterInfo.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
@@ -55,6 +56,14 @@ static MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
return X;
|
||||
}
|
||||
|
||||
static MCInstPrinter *createMSP430MCInstPrinter(const Target &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new MSP430InstPrinter(MAI);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMSP430TargetMC() {
|
||||
// Register the MC asm info.
|
||||
RegisterMCAsmInfo<MSP430MCAsmInfo> X(TheMSP430Target);
|
||||
@@ -73,4 +82,8 @@ extern "C" void LLVMInitializeMSP430TargetMC() {
|
||||
// Register the MC subtarget info.
|
||||
TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target,
|
||||
createMSP430MCSubtargetInfo);
|
||||
|
||||
// Register the MCInstPrinter.
|
||||
TargetRegistry::RegisterMCInstPrinter(TheMSP430Target,
|
||||
createMSP430MCInstPrinter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user