xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
1 //===-- llvm/Target/AMDGPU/AMDGPUMIRFormatter.h -----------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6 // See https://llvm.org/LICENSE.txt for license information.
7 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //
9 //===----------------------------------------------------------------------===//
10 //
11 /// \file
12 /// AMDGPU specific overrides of MIRFormatter.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_AMDGPUMIRFORMATTER_H
17 #define LLVM_LIB_TARGET_AMDGPUMIRFORMATTER_H
18 
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/CodeGen/MIRFormatter.h"
21 #include "llvm/CodeGen/PseudoSourceValue.h"
22 #include "llvm/Support/raw_ostream.h"
23 #include <cstdint>
24 
25 namespace llvm {
26 
27 class MachineFunction;
28 class MachineInstr;
29 struct PerFunctionMIParsingState;
30 struct SlotMapping;
31 
32 class AMDGPUMIRFormatter final : public MIRFormatter {
33 public:
34   AMDGPUMIRFormatter() {}
35   virtual ~AMDGPUMIRFormatter() = default;
36 
37   /// Implement target specific parsing of target custom pseudo source value.
38   virtual bool
39   parseCustomPseudoSourceValue(StringRef Src, MachineFunction &MF,
40                                PerFunctionMIParsingState &PFS,
41                                const PseudoSourceValue *&PSV,
42                                ErrorCallbackType ErrorCallback) const override;
43 };
44 
45 } // end namespace llvm
46 
47 #endif
48