diff options
| author | Richard Osborne <richard@xmos.com> | 2012-12-16 16:20:48 +0000 |
|---|---|---|
| committer | Richard Osborne <richard@xmos.com> | 2012-12-16 16:20:48 +0000 |
| commit | 3c31e21837e87cf66e568f77c8391a3179ea7827 (patch) | |
| tree | 4ba27f181eda401b869ca70f5c57fd2534c2ab41 /llvm/lib/Target/XCore/MCTargetDesc | |
| parent | b1de9f7e079ff8b70750c99040d85bec7729b225 (diff) | |
| download | bcm5719-llvm-3c31e21837e87cf66e568f77c8391a3179ea7827.tar.gz bcm5719-llvm-3c31e21837e87cf66e568f77c8391a3179ea7827.zip | |
Change XCoreAsmPrinter to lower MachineInstrs to MCInsts before emission.
This change adds XCoreMCInstLower to do the lowering to MCInst and
XCoreInstPrinter to print the MCInsts.
llvm-svn: 170288
Diffstat (limited to 'llvm/lib/Target/XCore/MCTargetDesc')
| -rw-r--r-- | llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt index a80c939b437..8213f9e4288 100644 --- a/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt +++ b/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt @@ -19,5 +19,5 @@ type = Library name = XCoreDesc parent = XCore -required_libraries = MC XCoreInfo +required_libraries = MC XCoreAsmPrinter XCoreInfo add_to_library_groups = XCore diff --git a/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp b/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp index bbfdd4356f2..048f9ebe058 100644 --- a/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp +++ b/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp @@ -13,6 +13,7 @@ #include "XCoreMCTargetDesc.h" #include "XCoreMCAsmInfo.h" +#include "InstPrinter/XCoreInstPrinter.h" #include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" @@ -69,6 +70,15 @@ static MCCodeGenInfo *createXCoreMCCodeGenInfo(StringRef TT, Reloc::Model RM, return X; } +static MCInstPrinter *createXCoreMCInstPrinter(const Target &T, + unsigned SyntaxVariant, + const MCAsmInfo &MAI, + const MCInstrInfo &MII, + const MCRegisterInfo &MRI, + const MCSubtargetInfo &STI) { + return new XCoreInstPrinter(MAI, MII, MRI); +} + // Force static initialization. extern "C" void LLVMInitializeXCoreTargetMC() { // Register the MC asm info. @@ -87,4 +97,8 @@ extern "C" void LLVMInitializeXCoreTargetMC() { // Register the MC subtarget info. TargetRegistry::RegisterMCSubtargetInfo(TheXCoreTarget, createXCoreMCSubtargetInfo); + + // Register the MCInstPrinter + TargetRegistry::RegisterMCInstPrinter(TheXCoreTarget, + createXCoreMCInstPrinter); } |

