Expose isXxxConstant() functions from SelectionDAGNodes.h (NFC)
[oota-llvm.git] / lib / Target / AMDGPU / AMDGPUDiagnosticInfoUnsupported.h
1 //===-- AMDGPUDiagnosticInfoUnsupported.h - Error reporting -----*- 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 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUDIAGNOSTICINFOUNSUPPORTED_H
11 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUDIAGNOSTICINFOUNSUPPORTED_H
12
13 #include "llvm/IR/DiagnosticInfo.h"
14 #include "llvm/IR/DiagnosticPrinter.h"
15
16 namespace llvm {
17
18 /// Diagnostic information for unimplemented or unsupported feature reporting.
19 class DiagnosticInfoUnsupported : public DiagnosticInfo {
20 private:
21   const Twine &Description;
22   const Function &Fn;
23
24   static int KindID;
25
26   static int getKindID() {
27     if (KindID == 0)
28       KindID = llvm::getNextAvailablePluginDiagnosticKind();
29     return KindID;
30   }
31
32 public:
33   DiagnosticInfoUnsupported(const Function &Fn, const Twine &Desc,
34                             DiagnosticSeverity Severity = DS_Error);
35
36   const Function &getFunction() const { return Fn; }
37   const Twine &getDescription() const { return Description; }
38
39   void print(DiagnosticPrinter &DP) const override;
40
41   static bool classof(const DiagnosticInfo *DI) {
42     return DI->getKind() == getKindID();
43   }
44 };
45
46 }
47
48 #endif