Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- C++ -*--===// |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 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 | // |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 10 | // This file declares the MSP430 specific subclass of TargetSubtargetInfo. |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H |
| 15 | #define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 16 | |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 17 | #include "MSP430FrameLowering.h" |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 18 | #include "MSP430ISelLowering.h" |
Chandler Carruth | d990388 | 2015-01-14 11:23:27 +0000 | [diff] [blame] | 19 | #include "MSP430InstrInfo.h" |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 20 | #include "MSP430RegisterInfo.h" |
| 21 | #include "MSP430SelectionDAGInfo.h" |
| 22 | #include "llvm/IR/DataLayout.h" |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 23 | #include "llvm/Target/TargetSubtargetInfo.h" |
Craig Topper | b25fda9 | 2012-03-17 18:46:09 +0000 | [diff] [blame] | 24 | #include <string> |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 25 | |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 26 | #define GET_SUBTARGETINFO_HEADER |
Evan Cheng | c9c090d | 2011-07-01 22:36:09 +0000 | [diff] [blame] | 27 | #include "MSP430GenSubtargetInfo.inc" |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 28 | |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 29 | namespace llvm { |
Evan Cheng | 1a72add6 | 2011-07-07 07:07:08 +0000 | [diff] [blame] | 30 | class StringRef; |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 31 | |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 32 | class MSP430Subtarget : public MSP430GenSubtargetInfo { |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 33 | virtual void anchor(); |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 34 | bool ExtendedInsts; |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 35 | MSP430FrameLowering FrameLowering; |
| 36 | MSP430InstrInfo InstrInfo; |
| 37 | MSP430TargetLowering TLInfo; |
| 38 | MSP430SelectionDAGInfo TSInfo; |
| 39 | |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 40 | public: |
| 41 | /// This constructor initializes the data members to match that |
Daniel Dunbar | 31b44e8 | 2009-08-02 22:11:08 +0000 | [diff] [blame] | 42 | /// of the specified triple. |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 43 | /// |
Evan Cheng | fe6e405 | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 44 | MSP430Subtarget(const std::string &TT, const std::string &CPU, |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 45 | const std::string &FS, const TargetMachine &TM); |
| 46 | |
| 47 | MSP430Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 48 | |
| 49 | /// ParseSubtargetFeatures - Parses features string setting specified |
| 50 | /// subtarget options. Definition of function is auto generated by tblgen. |
Evan Cheng | 1a72add6 | 2011-07-07 07:07:08 +0000 | [diff] [blame] | 51 | void ParseSubtargetFeatures(StringRef CPU, StringRef FS); |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 52 | |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 53 | const TargetFrameLowering *getFrameLowering() const override { |
| 54 | return &FrameLowering; |
| 55 | } |
| 56 | const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; } |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 57 | const TargetRegisterInfo *getRegisterInfo() const override { |
Eric Christopher | 1f86cca | 2014-06-27 01:14:54 +0000 | [diff] [blame] | 58 | return &InstrInfo.getRegisterInfo(); |
| 59 | } |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 60 | const MSP430TargetLowering *getTargetLowering() const override { |
| 61 | return &TLInfo; |
| 62 | } |
| 63 | const MSP430SelectionDAGInfo *getSelectionDAGInfo() const override { |
| 64 | return &TSInfo; |
| 65 | } |
Anton Korobeynikov | 1013800 | 2009-05-03 12:57:15 +0000 | [diff] [blame] | 66 | }; |
| 67 | } // End llvm namespace |
| 68 | |
| 69 | #endif // LLVM_TARGET_MSP430_SUBTARGET_H |