/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/Lanai/LanaiSubtarget.h
Line | Count | Source |
1 | | //=====-- LanaiSubtarget.h - Define Subtarget for the Lanai -----*- 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 Lanai specific subclass of TargetSubtarget. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #ifndef LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H |
15 | | #define LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H |
16 | | |
17 | | #include "LanaiFrameLowering.h" |
18 | | #include "LanaiISelLowering.h" |
19 | | #include "LanaiInstrInfo.h" |
20 | | #include "LanaiSelectionDAGInfo.h" |
21 | | #include "llvm/IR/DataLayout.h" |
22 | | #include "llvm/Target/TargetFrameLowering.h" |
23 | | #include "llvm/Target/TargetMachine.h" |
24 | | #include "llvm/Target/TargetSubtargetInfo.h" |
25 | | |
26 | | #define GET_SUBTARGETINFO_HEADER |
27 | | #include "LanaiGenSubtargetInfo.inc" |
28 | | |
29 | | namespace llvm { |
30 | | |
31 | | class LanaiSubtarget : public LanaiGenSubtargetInfo { |
32 | | public: |
33 | | // This constructor initializes the data members to match that |
34 | | // of the specified triple. |
35 | | LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu, |
36 | | StringRef FeatureString, const TargetMachine &TM, |
37 | | const TargetOptions &Options, CodeModel::Model CodeModel, |
38 | | CodeGenOpt::Level OptLevel); |
39 | | |
40 | | // ParseSubtargetFeatures - Parses features string setting specified |
41 | | // subtarget options. Definition of function is auto generated by tblgen. |
42 | | void ParseSubtargetFeatures(StringRef CPU, StringRef FS); |
43 | | |
44 | | LanaiSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); |
45 | | |
46 | | void initSubtargetFeatures(StringRef CPU, StringRef FS); |
47 | | |
48 | 293 | bool enableMachineScheduler() const override { return true; } |
49 | | |
50 | 5.35k | const LanaiInstrInfo *getInstrInfo() const override { return &InstrInfo; } |
51 | | |
52 | 1.77k | const TargetFrameLowering *getFrameLowering() const override { |
53 | 1.77k | return &FrameLowering; |
54 | 1.77k | } |
55 | | |
56 | 9.70k | const LanaiRegisterInfo *getRegisterInfo() const override { |
57 | 9.70k | return &InstrInfo.getRegisterInfo(); |
58 | 9.70k | } |
59 | | |
60 | 2.36k | const LanaiTargetLowering *getTargetLowering() const override { |
61 | 2.36k | return &TLInfo; |
62 | 2.36k | } |
63 | | |
64 | 89 | const LanaiSelectionDAGInfo *getSelectionDAGInfo() const override { |
65 | 89 | return &TSInfo; |
66 | 89 | } |
67 | | |
68 | | private: |
69 | | LanaiFrameLowering FrameLowering; |
70 | | LanaiInstrInfo InstrInfo; |
71 | | LanaiTargetLowering TLInfo; |
72 | | LanaiSelectionDAGInfo TSInfo; |
73 | | }; |
74 | | } // namespace llvm |
75 | | |
76 | | #endif // LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H |