LLVM  14.0.0git
R600AsmPrinter.h
Go to the documentation of this file.
1 //===-- R600AsmPrinter.h - Print R600 assembly code -------------*- C++ -*-===//
2 //
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
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 
18 
19 namespace llvm {
20 
21 class R600AsmPrinter final : public AsmPrinter {
22 
23 public:
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 *
41  std::unique_ptr<MCStreamer> &&Streamer);
42 
43 } // namespace llvm
44 
45 #endif // LLVM_LIB_TARGET_AMDGPU_R600ASMPRINTER_H
AsmPrinter.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::R600AsmPrinter::lowerConstant
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
Definition: R600MCInstLower.cpp:69
llvm::R600AsmPrinter
Definition: R600AsmPrinter.h:21
llvm::R600AsmPrinter::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
Definition: R600AsmPrinter.cpp:103
llvm::R600AsmPrinter::R600AsmPrinter
R600AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
Definition: R600AsmPrinter.cpp:36
llvm::R600AsmPrinter::emitInstruction
void emitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
Definition: R600MCInstLower.cpp:44
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::AsmPrinter::MF
MachineFunction * MF
The current machine function.
Definition: AsmPrinter.h:99
llvm::MachineFunction
Definition: MachineFunction.h:234
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::createR600AsmPrinterPass
AsmPrinter * createR600AsmPrinterPass(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer)
Definition: R600AsmPrinter.cpp:31
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
llvm::R600AsmPrinter::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: R600AsmPrinter.cpp:40
llvm::AsmPrinter::TM
TargetMachine & TM
Target machine description.
Definition: AsmPrinter.h:84
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35