Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 1 | //===-- PTXAsmPrinter.cpp - PTX LLVM assembly writer ----------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains a printer that converts from our internal representation |
| 11 | // of machine-dependent LLVM code to PTX assembly language. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "PTX.h" |
| 16 | #include "PTXTargetMachine.h" |
| 17 | #include "llvm/CodeGen/AsmPrinter.h" |
| 18 | #include "llvm/Target/TargetRegistry.h" |
| 19 | |
| 20 | using namespace llvm; |
| 21 | |
| 22 | namespace { |
| 23 | class PTXAsmPrinter : public AsmPrinter { |
| 24 | public: |
| 25 | explicit PTXAsmPrinter(TargetMachine &TM, MCStreamer &Streamer) : |
| 26 | AsmPrinter(TM, Streamer) {} |
| 27 | const char *getPassName() const { return "PTX Assembly Printer"; } |
| 28 | }; |
| 29 | } // namespace |
| 30 | |
| 31 | // Force static initialization. |
| 32 | extern "C" void LLVMInitializePTXAsmPrinter() |
| 33 | { |
| 34 | RegisterAsmPrinter<PTXAsmPrinter> X(ThePTXTarget); |
| 35 | } |