LLVM  8.0.0svn
MSP430Subtarget.h
Go to the documentation of this file.
1 //===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- 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 MSP430 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
15 #define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
16 
17 #include "MSP430FrameLowering.h"
18 #include "MSP430ISelLowering.h"
19 #include "MSP430InstrInfo.h"
20 #include "MSP430RegisterInfo.h"
23 #include "llvm/IR/DataLayout.h"
24 #include <string>
25 
26 #define GET_SUBTARGETINFO_HEADER
27 #include "MSP430GenSubtargetInfo.inc"
28 
29 namespace llvm {
30 class StringRef;
31 
33 public:
34  enum HWMultEnum {
36  };
37 
38 private:
39  virtual void anchor();
40  bool ExtendedInsts;
41  HWMultEnum HWMultMode;
42  MSP430FrameLowering FrameLowering;
43  MSP430InstrInfo InstrInfo;
44  MSP430TargetLowering TLInfo;
46 
47 public:
48  /// This constructor initializes the data members to match that
49  /// of the specified triple.
50  ///
51  MSP430Subtarget(const Triple &TT, const std::string &CPU,
52  const std::string &FS, const TargetMachine &TM);
53 
55 
56  /// ParseSubtargetFeatures - Parses features string setting specified
57  /// subtarget options. Definition of function is auto generated by tblgen.
59 
60  bool hasHWMult16() const { return HWMultMode == HWMult16; }
61  bool hasHWMult32() const { return HWMultMode == HWMult32; }
62  bool hasHWMultF5() const { return HWMultMode == HWMultF5; }
63 
64  const TargetFrameLowering *getFrameLowering() const override {
65  return &FrameLowering;
66  }
67  const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; }
68  const TargetRegisterInfo *getRegisterInfo() const override {
69  return &InstrInfo.getRegisterInfo();
70  }
71  const MSP430TargetLowering *getTargetLowering() const override {
72  return &TLInfo;
73  }
74  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
75  return &TSInfo;
76  }
77 };
78 } // End llvm namespace
79 
80 #endif // LLVM_TARGET_MSP430_SUBTARGET_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool hasHWMult16() const
bool hasHWMult32() const
const TargetRegisterInfo * getRegisterInfo() const override
MSP430Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const MSP430TargetLowering * getTargetLowering() const override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Information about stack frame layout on the target.
bool hasHWMultF5() const
const MSP430InstrInfo * getInstrInfo() const override
MSP430Subtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
const TargetFrameLowering * getFrameLowering() const override
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
const TargetRegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.