diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-10-20 05:15:36 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-10-20 05:15:36 +0000 |
commit | 2685a29a8d4ced7791bb671e28f9fe51c74eb3bb (patch) | |
tree | b9a285701c8eb1ed109d5f065831b4722b185e7b /lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | |
parent | 07adb85cb7f97968b3b9a102e5fa504a5f6ac682 (diff) |
Wire up the ARM MCInst printer, for llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp')
-rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 66cc6f3674..6ed7e8e4cf 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -1301,13 +1301,6 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { } } -// Force static initialization. -extern "C" void LLVMInitializeARMAsmPrinter() { - RegisterAsmPrinter<ARMAsmPrinter> X(TheARMTarget); - RegisterAsmPrinter<ARMAsmPrinter> Y(TheThumbTarget); -} - - //===----------------------------------------------------------------------===// void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) { @@ -1457,3 +1450,26 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) { printMCInst(&TmpInst); } + +//===----------------------------------------------------------------------===// +// Target Registry Stuff +//===----------------------------------------------------------------------===// + +static MCInstPrinter *createARMMCInstPrinter(const Target &T, + unsigned SyntaxVariant, + const MCAsmInfo &MAI, + raw_ostream &O) { + if (SyntaxVariant == 0) + return new ARMInstPrinter(O, MAI, false); + return 0; +} + +// Force static initialization. +extern "C" void LLVMInitializeARMAsmPrinter() { + RegisterAsmPrinter<ARMAsmPrinter> X(TheARMTarget); + RegisterAsmPrinter<ARMAsmPrinter> Y(TheThumbTarget); + + TargetRegistry::RegisterMCInstPrinter(TheARMTarget, createARMMCInstPrinter); + TargetRegistry::RegisterMCInstPrinter(TheThumbTarget, createARMMCInstPrinter); +} + |