LLVM  3.7.0
BPFSubtarget.h
Go to the documentation of this file.
1 //===-- BPFSubtarget.h - Define Subtarget for the BPF -----------*- 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 BPF specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_BPF_BPFSUBTARGET_H
15 #define LLVM_LIB_TARGET_BPF_BPFSUBTARGET_H
16 
17 #include "BPFFrameLowering.h"
18 #include "BPFISelLowering.h"
19 #include "BPFInstrInfo.h"
21 #include "llvm/IR/DataLayout.h"
24 
25 #define GET_SUBTARGETINFO_HEADER
26 #include "BPFGenSubtargetInfo.inc"
27 
28 namespace llvm {
29 class StringRef;
30 
32  virtual void anchor();
33  BPFInstrInfo InstrInfo;
34  BPFFrameLowering FrameLowering;
35  BPFTargetLowering TLInfo;
37 
38 public:
39  // This constructor initializes the data members to match that
40  // of the specified triple.
41  BPFSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
42  const TargetMachine &TM);
43 
44  // ParseSubtargetFeatures - Parses features string setting specified
45  // subtarget options. Definition of function is auto generated by tblgen.
47 
48  const BPFInstrInfo *getInstrInfo() const override { return &InstrInfo; }
49  const BPFFrameLowering *getFrameLowering() const override {
50  return &FrameLowering;
51  }
52  const BPFTargetLowering *getTargetLowering() const override {
53  return &TLInfo;
54  }
55  const TargetSelectionDAGInfo *getSelectionDAGInfo() const override {
56  return &TSInfo;
57  }
58  const TargetRegisterInfo *getRegisterInfo() const override {
59  return &InstrInfo.getRegisterInfo();
60  }
61 };
62 } // End llvm namespace
63 
64 #endif
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
const TargetSelectionDAGInfo * getSelectionDAGInfo() const override
Definition: BPFSubtarget.h:55
const BPFTargetLowering * getTargetLowering() const override
Definition: BPFSubtarget.h:52
TargetSelectionDAGInfo - Targets can subclass this to parameterize the SelectionDAG lowering and inst...
BPFSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
const BPFInstrInfo * getInstrInfo() const override
Definition: BPFSubtarget.h:48
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const TargetRegisterInfo * getRegisterInfo() const override
Definition: BPFSubtarget.h:58
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const BPFFrameLowering * getFrameLowering() const override
Definition: BPFSubtarget.h:49
const BPFRegisterInfo & getRegisterInfo() const
Definition: BPFInstrInfo.h:31
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40