Tom Stellard | c501501 | 2018-05-24 20:02:01 +0000 | [diff] [blame^] | 1 | //===-- R600AsmPrinter.h - Print R600 assembly code -------------*- C++ -*-===// |
| 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 | /// \file |
| 11 | /// R600 Assembly printer class. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |
| 16 | #define LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |
| 17 | |
| 18 | #include "llvm/CodeGen/AsmPrinter.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | class R600AsmPrinter final : public AsmPrinter { |
| 23 | |
| 24 | public: |
| 25 | explicit R600AsmPrinter(TargetMachine &TM, |
| 26 | std::unique_ptr<MCStreamer> Streamer); |
| 27 | StringRef getPassName() const override; |
| 28 | bool runOnMachineFunction(MachineFunction &MF) override; |
| 29 | /// Implemented in AMDGPUMCInstLower.cpp |
| 30 | void EmitInstruction(const MachineInstr *MI) override; |
| 31 | /// Lower the specified LLVM Constant to an MCExpr. |
| 32 | /// The AsmPrinter::lowerConstantof does not know how to lower |
| 33 | /// addrspacecast, therefore they should be lowered by this function. |
| 34 | const MCExpr *lowerConstant(const Constant *CV) override; |
| 35 | |
| 36 | private: |
| 37 | void EmitProgramInfoR600(const MachineFunction &MF); |
| 38 | }; |
| 39 | |
| 40 | AsmPrinter * |
| 41 | createR600AsmPrinterPass(TargetMachine &TM, |
| 42 | std::unique_ptr<MCStreamer> &&Streamer); |
| 43 | |
| 44 | } // namespace llvm |
| 45 | |
| 46 | #endif // LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |