1//===-- GISelAccessor.h - GISel Accessor ------------------------*- 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/// This file declares the API to access the various APIs related
11/// to GlobalISel.
12//
13//===----------------------------------------------------------------------===/
14
15#ifndef LLVM_CODEGEN_GLOBALISEL_GISELACCESSOR_H
16#define LLVM_CODEGEN_GLOBALISEL_GISELACCESSOR_H
17
18namespace llvm {
19class CallLowering;
20class InstructionSelector;
21class LegalizerInfo;
22class RegisterBankInfo;
23
24/// The goal of this helper class is to gather the accessor to all
25/// the APIs related to GlobalISel.
26/// It should be derived to feature an actual accessor to the GISel APIs.
27/// The reason why this is not simply done into the subtarget is to avoid
28/// spreading ifdefs around.
29struct GISelAccessor {
30  virtual ~GISelAccessor() {}
31  virtual const CallLowering *getCallLowering() const { return nullptr;}
32  virtual const InstructionSelector *getInstructionSelector() const {
33    return nullptr;
34  }
35  virtual const LegalizerInfo *getLegalizerInfo() const { return nullptr; }
36  virtual const RegisterBankInfo *getRegBankInfo() const { return nullptr;}
37};
38} // End namespace llvm;
39#endif
40