Tom Stellard | c501501 | 2018-05-24 20:02:01 +0000 | [diff] [blame] | 1 | //===-- R600AsmPrinter.h - Print R600 assembly code -------------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame^] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Tom Stellard | c501501 | 2018-05-24 20:02:01 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | /// \file |
| 10 | /// R600 Assembly printer class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |
| 15 | #define LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |
| 16 | |
| 17 | #include "llvm/CodeGen/AsmPrinter.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | class R600AsmPrinter final : public AsmPrinter { |
| 22 | |
| 23 | public: |
| 24 | explicit R600AsmPrinter(TargetMachine &TM, |
| 25 | std::unique_ptr<MCStreamer> Streamer); |
| 26 | StringRef getPassName() const override; |
| 27 | bool runOnMachineFunction(MachineFunction &MF) override; |
| 28 | /// Implemented in AMDGPUMCInstLower.cpp |
| 29 | void EmitInstruction(const MachineInstr *MI) override; |
| 30 | /// Lower the specified LLVM Constant to an MCExpr. |
| 31 | /// The AsmPrinter::lowerConstantof does not know how to lower |
| 32 | /// addrspacecast, therefore they should be lowered by this function. |
| 33 | const MCExpr *lowerConstant(const Constant *CV) override; |
| 34 | |
| 35 | private: |
| 36 | void EmitProgramInfoR600(const MachineFunction &MF); |
| 37 | }; |
| 38 | |
| 39 | AsmPrinter * |
| 40 | createR600AsmPrinterPass(TargetMachine &TM, |
| 41 | std::unique_ptr<MCStreamer> &&Streamer); |
| 42 | |
| 43 | } // namespace llvm |
| 44 | |
| 45 | #endif // LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H |